bstraehle commited on
Commit
a84efc1
·
1 Parent(s): 55701a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -50,16 +50,19 @@ def invoke(prompt):
50
  # temperature = config["temperature"],
51
  # top_k = config["top_k"],
52
  # top_p = config["top_p"],
53
- # ).text
 
 
54
  completion = generation_model.generate_content(prompt, generation_config = {
55
  "max_output_tokens": config["max_output_tokens"],
56
  "temperature": config["temperature"],
57
  "top_k": config["top_k"],
58
  "top_p": config["top_p"],
59
- }).text
 
 
60
  except Exception as e:
61
  completion = e
62
- print(completion)
63
  raise gr.Error(e)
64
  finally:
65
  wandb_log(prompt, completion)
 
50
  # temperature = config["temperature"],
51
  # top_k = config["top_k"],
52
  # top_p = config["top_p"],
53
+ # )
54
+ #if (completion.text != None):
55
+ # completion = completion.text
56
  completion = generation_model.generate_content(prompt, generation_config = {
57
  "max_output_tokens": config["max_output_tokens"],
58
  "temperature": config["temperature"],
59
  "top_k": config["top_k"],
60
  "top_p": config["top_p"],
61
+ })
62
+ if (completion.text != None):
63
+ completion = completion.text
64
  except Exception as e:
65
  completion = e
 
66
  raise gr.Error(e)
67
  finally:
68
  wandb_log(prompt, completion)