Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
hf_token = os.getenv('TEST_TOKEN')
|
| 6 |
+
print(f"Hugging Face token: {hf_token}")
|
| 7 |
+
|
| 8 |
+
if hf_token is None:
|
| 9 |
+
raise ValueError("Hugging Face token not found")
|
| 10 |
+
|
| 11 |
+
with gr.Blocks() as demo:
|
| 12 |
+
token_input = gr.Textbox(label="Important token", value=hf_token)
|
| 13 |
+
output = gr.Textbox(label="Important token output")
|
| 14 |
+
btn = gr.Button("Submit")
|
| 15 |
+
|
| 16 |
+
btn.click(lambda x:x, inputs=token_input, outputs=[output])
|
| 17 |
+
|
| 18 |
+
if __name__ == "__main__":
|
| 19 |
+
demo.launch()
|