Spaces:
Build error
Build error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
chatbot = pipeline("text-generation", model="gpt2")
|
| 5 |
+
|
| 6 |
+
def respond(message):
|
| 7 |
+
response = chatbot(message, max_length=100, do_sample=True)[0]["generated_text"]
|
| 8 |
+
return response
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=respond, inputs="text", outputs="text", title="روبوت ذكاء اصطناعي بسيط")
|
| 11 |
+
iface.launch()
|