Update app.py
Browse files
app.py
CHANGED
@@ -9,22 +9,22 @@ tokenizer1 = AutoTokenizer.from_pretrained("pedramyazdipoor/persian_xlm_roberta_
|
|
9 |
|
10 |
roberta_large = pipeline(task='question-answering', model=model1, tokenizer=tokenizer1)
|
11 |
|
12 |
-
def Q_A(
|
13 |
answer_pedram = roberta_large({"question":question, "context":context})['answer']
|
14 |
return answer_pedram
|
15 |
|
16 |
|
17 |
|
18 |
# Create title, description and article strings
|
19 |
-
title = "Question and answer based on Roberta model"
|
20 |
description = "سیستم پردازش زبانی پرسش و پاسخ"
|
21 |
article = "آموزش داده شده با مدل زبانی روبرتا"
|
22 |
|
23 |
|
24 |
demo = gr.Interface(fn=Q_A, # mapping function from input to output
|
25 |
-
inputs=[gr.Textbox(label='پرسش
|
26 |
-
gr.Textbox(label='متن منبع خود را وارد کنید', show_label=True, text_align='right')], # what are the inputs?
|
27 |
-
outputs=gr.Text(), # what are the outputs?
|
28 |
# our fn has two outputs, therefore we have two outputs
|
29 |
# Create examples list from "examples/" directory
|
30 |
title=title,
|
|
|
9 |
|
10 |
roberta_large = pipeline(task='question-answering', model=model1, tokenizer=tokenizer1)
|
11 |
|
12 |
+
def Q_A(question, context):
|
13 |
answer_pedram = roberta_large({"question":question, "context":context})['answer']
|
14 |
return answer_pedram
|
15 |
|
16 |
|
17 |
|
18 |
# Create title, description and article strings
|
19 |
+
title = "Question and answer based on Roberta model develop by nima asl toghiri"
|
20 |
description = "سیستم پردازش زبانی پرسش و پاسخ"
|
21 |
article = "آموزش داده شده با مدل زبانی روبرتا"
|
22 |
|
23 |
|
24 |
demo = gr.Interface(fn=Q_A, # mapping function from input to output
|
25 |
+
inputs=[gr.Textbox(label='پرسش خود را وارد کنید:', show_label=True, text_align='right', lines=2),
|
26 |
+
gr.Textbox(label='متن منبع خود را وارد کنید', show_label=True, text_align='right', lines=8)], # what are the inputs?
|
27 |
+
outputs=gr.Text(show_copy_button=True), # what are the outputs?
|
28 |
# our fn has two outputs, therefore we have two outputs
|
29 |
# Create examples list from "examples/" directory
|
30 |
title=title,
|