tlkh commited on
Commit
6be09f7
·
1 Parent(s): cb39e31
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +7 -2
  2. app.py +7 -2
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -17,7 +17,7 @@ def infer(s1, s2):
17
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
- elif "generated_text" in data:
21
  return data["generated_text"]
22
  else:
23
  return data
@@ -26,6 +26,11 @@ title = "Paraphrase Classification and Explanation"
26
  desc = "Classify and explain the semantic relationship between the two sentences"
27
  long_desc = "This is a Flan-T5-Large model fine-tuned to perform paraphrase classification and explanation. It takes in two sentences as inputs."
28
 
29
- demo = gr.Interface(fn=infer, inputs=["text", "text"], outputs="text")
30
 
 
 
 
 
 
31
  demo.launch()
 
17
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
+ elif "generated_text" in data[0]:
21
  return data["generated_text"]
22
  else:
23
  return data
 
26
  desc = "Classify and explain the semantic relationship between the two sentences"
27
  long_desc = "This is a Flan-T5-Large model fine-tuned to perform paraphrase classification and explanation. It takes in two sentences as inputs."
28
 
29
+ example1 = ["On Monday, Tom went to the market.","Tom went to the market on Monday."]
30
 
31
+ demo = gr.Interface(fn=infer, inputs=["text", "text"], outputs="text",
32
+ examples=[example1,]
33
+ title=title,
34
+ description=desc,
35
+ article=long_desc)
36
  demo.launch()
app.py CHANGED
@@ -17,7 +17,7 @@ def infer(s1, s2):
17
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
- elif "generated_text" in data:
21
  return data["generated_text"]
22
  else:
23
  return data
@@ -26,6 +26,11 @@ title = "Paraphrase Classification and Explanation"
26
  desc = "Classify and explain the semantic relationship between the two sentences"
27
  long_desc = "This is a Flan-T5-Large model fine-tuned to perform paraphrase classification and explanation. It takes in two sentences as inputs."
28
 
29
- demo = gr.Interface(fn=infer, inputs=["text", "text"], outputs="text")
30
 
 
 
 
 
 
31
  demo.launch()
 
17
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
+ elif "generated_text" in data[0]:
21
  return data["generated_text"]
22
  else:
23
  return data
 
26
  desc = "Classify and explain the semantic relationship between the two sentences"
27
  long_desc = "This is a Flan-T5-Large model fine-tuned to perform paraphrase classification and explanation. It takes in two sentences as inputs."
28
 
29
+ example1 = ["On Monday, Tom went to the market.","Tom went to the market on Monday."]
30
 
31
+ demo = gr.Interface(fn=infer, inputs=["text", "text"], outputs="text",
32
+ examples=[example1,]
33
+ title=title,
34
+ description=desc,
35
+ article=long_desc)
36
  demo.launch()