Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files
app.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from huggingface_hub import InferenceClient
|
| 4 |
+
|
| 5 |
+
client = InferenceClient("google/gemma-2b-it")
|
| 6 |
+
|
| 7 |
+
def generate_text(prompt):
|
| 8 |
+
response = client.text_generation(prompt, max_new_tokens=50)
|
| 9 |
+
return response
|
| 10 |
+
|
| 11 |
+
demo = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|
| 12 |
+
demo.launch()
|
| 13 |
+
|