Spaces:
Build error
Build error
marksverdhei
commited on
Commit
β’
84bb4b2
1
Parent(s):
47a451b
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ Enter a word and a sentence that uses the word. We then generate a definition
|
|
9 |
"""
|
10 |
|
11 |
|
12 |
-
def predict(word, example):
|
13 |
input_text = f"define \"{word}\": {example}"
|
14 |
output = model(input_text, truncation=True)
|
15 |
output_text = output[0]["generated_text"]
|
@@ -17,13 +17,11 @@ def predict(word, example):
|
|
17 |
|
18 |
|
19 |
gr.Interface(
|
20 |
-
fn=
|
21 |
-
inputs=["text", "text"
|
22 |
outputs=[
|
23 |
-
gr.Textbox(label="
|
24 |
-
gr.Textbox(label="example sentence using word")
|
25 |
],
|
26 |
-
|
27 |
title="Word definition",
|
28 |
description=description,
|
29 |
).launch()
|
|
|
9 |
"""
|
10 |
|
11 |
|
12 |
+
def predict(word, example) -> str:
|
13 |
input_text = f"define \"{word}\": {example}"
|
14 |
output = model(input_text, truncation=True)
|
15 |
output_text = output[0]["generated_text"]
|
|
|
17 |
|
18 |
|
19 |
gr.Interface(
|
20 |
+
fn=predict,
|
21 |
+
inputs=["text", "text"],
|
22 |
outputs=[
|
23 |
+
gr.Textbox(label="Generated definition")
|
|
|
24 |
],
|
|
|
25 |
title="Word definition",
|
26 |
description=description,
|
27 |
).launch()
|