Sanchit Gandhi commited on
Commit
7ba6f92
·
1 Parent(s): f7c91fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -48,7 +48,7 @@ examples = [
48
  64, "sampling", True],
49
  ["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 64, "greedy", True],
50
  ["Math exercise - answers:\n34+10=44\n54+20=", 64, "sampling", True],
51
- ["Python code to compute the factorial of a given number:", 64, "greedy", True],
52
  ["Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:",
53
  64, "sampling", True],
54
  ["spelling test answers.\nWhat are the letters in « language »?\nAnswer: l-a-n-g-u-a-g-e\nWhat are the letters in « Romanian »?\nAnswer:",
@@ -60,7 +60,7 @@ examples = [
60
 
61
  def query(payload):
62
  print(payload)
63
- response = requests.post(API_URL, json=payload)
64
  print(response)
65
  return response.json()
66
 
@@ -78,7 +78,7 @@ def inference(input_sentence, max_length, sample_or_greedy, raw_text=True):
78
  )
79
 
80
  if raw_text:
81
- return None, data
82
 
83
  width, height = 3326, 3326
84
  assets_path = "assets"
 
48
  64, "sampling", True],
49
  ["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 64, "greedy", True],
50
  ["Math exercise - answers:\n34+10=44\n54+20=", 64, "sampling", True],
51
+ ["Python - code to compute the factorial of a number:", 64, "greedy", True],
52
  ["Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:",
53
  64, "sampling", True],
54
  ["spelling test answers.\nWhat are the letters in « language »?\nAnswer: l-a-n-g-u-a-g-e\nWhat are the letters in « Romanian »?\nAnswer:",
 
60
 
61
  def query(payload):
62
  print(payload)
63
+ response = requests.get(API_URL, json=payload)
64
  print(response)
65
  return response.json()
66
 
 
78
  )
79
 
80
  if raw_text:
81
+ return None, data[0]['generated_text'][0]
82
 
83
  width, height = 3326, 3326
84
  assets_path = "assets"