Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
import random
|
3 |
-
import string
|
4 |
|
5 |
class HangmanGame:
|
6 |
def __init__(self):
|
@@ -96,14 +94,9 @@ def guess_interface(guess):
|
|
96 |
message, display, attempts = game.make_guess(guess)
|
97 |
return message, display, attempts
|
98 |
|
99 |
-
def generate_random_subdomain(length=8):
|
100 |
-
"""Generate a random subdomain for the Hugging Face Spaces URL."""
|
101 |
-
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length))
|
102 |
-
|
103 |
def generate_cast_link():
|
104 |
-
"""Generate a Hugging Face Spaces
|
105 |
-
|
106 |
-
return f"https://{subdomain}-hangman-game.hf.space/"
|
107 |
|
108 |
# Create Gradio interface
|
109 |
with gr.Blocks() as demo:
|
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
class HangmanGame:
|
4 |
def __init__(self):
|
|
|
94 |
message, display, attempts = game.make_guess(guess)
|
95 |
return message, display, attempts
|
96 |
|
|
|
|
|
|
|
|
|
97 |
def generate_cast_link():
|
98 |
+
"""Generate a static Hugging Face Spaces share link."""
|
99 |
+
return "https://serverx-hangman-game.hf.space/"
|
|
|
100 |
|
101 |
# Create Gradio interface
|
102 |
with gr.Blocks() as demo:
|