File size: 455 Bytes
e451c49
c72b9d8
e451c49
3bbfa05
 
 
 
 
 
c72b9d8
 
 
 
 
 
 
 
 
 
e451c49
3bbfa05
e451c49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from transformers import pipeline

gr.Interface.load("models/deepset/roberta-base-squad2-distilled").launch()

'''
modes_name = "deepset/roberta-base-squad2"

pipe = pipeline("question-answering", model=model_name, tokenizer=model_name)

def predict(text):
  return pipe(text)[0]["translation_text"]

iface = gr.Interface(
  fn=predict, 
  inputs='text',
  outputs='text',
  examples=[["Hello! My name is Omar"]]
)

iface.launch()'''