Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import requests
|
|
5 |
import gradio as gr
|
6 |
from transformers import pipeline
|
7 |
|
8 |
-
SEARCH_TEMPLATE = "https://
|
9 |
-
CONTENT_TEMPLATE = "https://
|
10 |
|
11 |
summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
|
12 |
|
@@ -39,8 +39,8 @@ with demo:
|
|
39 |
gr.Markdown("This chatbot queries the Wikipedia API and summarizes the top result.")
|
40 |
|
41 |
chatbot = gr.Chatbot()
|
42 |
-
msg = gr.Textbox(label="
|
43 |
-
clear = gr.Button("
|
44 |
|
45 |
msg.submit(chatbot_response, [msg, chatbot], chatbot).then(
|
46 |
lambda: gr.update(value=""), None, [msg], queue=False
|
|
|
5 |
import gradio as gr
|
6 |
from transformers import pipeline
|
7 |
|
8 |
+
SEARCH_TEMPLATE = "https://ar.wikipedia.org/w/api.php?action=opensearch&search=%s&limit=1&namespace=0&format=json"
|
9 |
+
CONTENT_TEMPLATE = "https://ar.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&exintro&explaintext&redirects=1&titles=%s"
|
10 |
|
11 |
summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
|
12 |
|
|
|
39 |
gr.Markdown("This chatbot queries the Wikipedia API and summarizes the top result.")
|
40 |
|
41 |
chatbot = gr.Chatbot()
|
42 |
+
msg = gr.Textbox(label="ادخل سؤالك")
|
43 |
+
clear = gr.Button("امسح")
|
44 |
|
45 |
msg.submit(chatbot_response, [msg, chatbot], chatbot).then(
|
46 |
lambda: gr.update(value=""), None, [msg], queue=False
|