tlkh commited on
Commit
529f20b
·
1 Parent(s): 2ddfa8f
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +7 -7
  2. app.py +7 -7
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -18,7 +18,7 @@ def infer(s1, s2):
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
24
 
@@ -26,20 +26,20 @@ 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
- example1 = ["On Monday, Tom went to the market.","Tom went to the market on Monday."]
30
-
31
- s1 = gr.Textbox(value="One",label="Sentence 1")
32
- s2 = gr.Textbox(value="Two",label="Sentence 2")
33
 
34
  examples = gr.Examples(
35
  examples=[
36
  ["one", "two"],
37
  ],
38
  inputs=[s1, s2],
39
- )
40
 
41
  demo = gr.Interface(fn=infer, inputs=[s1,s2], outputs="text",
42
  title=title,
43
  description=desc,
44
- article=long_desc)
 
 
45
  demo.launch()
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
  elif "generated_text" in data[0]:
21
+ return data[0]["generated_text"]
22
  else:
23
  return data
24
 
 
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
+ s1 = gr.Textbox(value="On Monday, Tom went to the market.",label="Sentence 1")
30
+ s2 = gr.Textbox(value="Tom went to the market.",label="Sentence 2")
 
 
31
 
32
  examples = gr.Examples(
33
  examples=[
34
  ["one", "two"],
35
  ],
36
  inputs=[s1, s2],
37
+ )
38
 
39
  demo = gr.Interface(fn=infer, inputs=[s1,s2], outputs="text",
40
  title=title,
41
  description=desc,
42
+ article=long_desc,
43
+ )
44
+
45
  demo.launch()
app.py CHANGED
@@ -18,7 +18,7 @@ def infer(s1, s2):
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
24
 
@@ -26,20 +26,20 @@ 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
- example1 = ["On Monday, Tom went to the market.","Tom went to the market on Monday."]
30
-
31
- s1 = gr.Textbox(value="One",label="Sentence 1")
32
- s2 = gr.Textbox(value="Two",label="Sentence 2")
33
 
34
  examples = gr.Examples(
35
  examples=[
36
  ["one", "two"],
37
  ],
38
  inputs=[s1, s2],
39
- )
40
 
41
  demo = gr.Interface(fn=infer, inputs=[s1,s2], outputs="text",
42
  title=title,
43
  description=desc,
44
- article=long_desc)
 
 
45
  demo.launch()
 
18
  if "error" in data:
19
  return "Error: "+ data["error"]
20
  elif "generated_text" in data[0]:
21
+ return data[0]["generated_text"]
22
  else:
23
  return data
24
 
 
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
+ s1 = gr.Textbox(value="On Monday, Tom went to the market.",label="Sentence 1")
30
+ s2 = gr.Textbox(value="Tom went to the market.",label="Sentence 2")
 
 
31
 
32
  examples = gr.Examples(
33
  examples=[
34
  ["one", "two"],
35
  ],
36
  inputs=[s1, s2],
37
+ )
38
 
39
  demo = gr.Interface(fn=infer, inputs=[s1,s2], outputs="text",
40
  title=title,
41
  description=desc,
42
+ article=long_desc,
43
+ )
44
+
45
  demo.launch()