Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import random
|
|
|
|
|
|
|
| 2 |
|
| 3 |
|
| 4 |
class WordleEnv:
|
|
@@ -59,7 +61,28 @@ class WordleEnv:
|
|
| 59 |
return self._obs, reward, done
|
| 60 |
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
demo = get_demo(WordleEnv)
|
| 65 |
demo.launch(mcp_server=True)
|
|
|
|
|
|
| 1 |
import random
|
| 2 |
+
from environments import register_env
|
| 3 |
+
import gradio as gr
|
| 4 |
|
| 5 |
|
| 6 |
class WordleEnv:
|
|
|
|
| 61 |
return self._obs, reward, done
|
| 62 |
|
| 63 |
|
| 64 |
+
with gr.Blocks() as demo:
|
| 65 |
+
gr.Markdown(
|
| 66 |
+
"""# Wordle Environment
|
| 67 |
+
|
| 68 |
+
Usage:
|
| 69 |
+
|
| 70 |
+
```shell
|
| 71 |
+
pip install git+https://github.com/huggingface/environments.git
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
>>> from environments import load
|
| 76 |
+
>>> env = load("qgallouedec/wordle")
|
| 77 |
+
Loaded as API: https://qgallouedec-counter.hf.space/ ✔
|
| 78 |
+
>>> env.reset()
|
| 79 |
+
('Counter reset to 0', 0.0, False)
|
| 80 |
+
>>> env.step()
|
| 81 |
+
('Counter is now 1', 1.0, False)
|
| 82 |
+
```
|
| 83 |
+
"""
|
| 84 |
+
)
|
| 85 |
+
register_env(WordleEnv)
|
| 86 |
|
|
|
|
| 87 |
demo.launch(mcp_server=True)
|
| 88 |
+
|