wop commited on
Commit
50d2a7f
·
verified ·
1 Parent(s): a7a1d1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -40,11 +40,12 @@ def generate(
40
  if formatted_prompt in database:
41
  response = database[formatted_prompt]
42
  else:
43
- response = next(client.text_generation(formatted_prompt, details=True, return_full_text=False)).token.text
44
- database[formatted_prompt] = response
 
45
  save_database(database) # Save the updated database
46
 
47
- yield response
48
 
49
  css = """
50
  #mkd {
 
40
  if formatted_prompt in database:
41
  response = database[formatted_prompt]
42
  else:
43
+ response = client.text_generation(formatted_prompt, details=True, return_full_text=False)
44
+ response_text = response.generated_tokens[0].text
45
+ database[formatted_prompt] = response_text
46
  save_database(database) # Save the updated database
47
 
48
+ yield response_text
49
 
50
  css = """
51
  #mkd {