cavomo commited on
Commit
ac4dc2b
·
verified ·
1 Parent(s): 96bfd3f

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
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()