sdafd commited on
Commit
3c2099f
·
verified ·
1 Parent(s): 7bfce13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -54,7 +54,6 @@ def process_files(files, model_type):
54
  def chat_submit_func(message, files, chat_history, model, temperature, top_p, max_tokens, api_key):
55
  print(model)
56
  client = genai.Client(api_key=api_key)
57
- gen_model = client.models.get(model=model)
58
 
59
  # Prepare inputs
60
  if model_types[model] == "text" and files:
@@ -73,7 +72,7 @@ def chat_submit_func(message, files, chat_history, model, temperature, top_p, ma
73
  }
74
 
75
  try:
76
- response = gen_model.generate_content(inputs, generation_config=generation_config)
77
  response_text = ""
78
  response_images = []
79
 
@@ -107,7 +106,6 @@ def chat_submit_func(message, files, chat_history, model, temperature, top_p, ma
107
  def single_submit_func(prompt, files, model, temperature, top_p, max_tokens, api_key):
108
  print(model)
109
  client = genai.Client(api_key=api_key)
110
- gen_model = client.models.get(model=model)
111
 
112
  # Prepare inputs
113
  if model_types[model] == "text" and files:
@@ -127,7 +125,7 @@ def single_submit_func(prompt, files, model, temperature, top_p, max_tokens, api
127
  }
128
 
129
  try:
130
- response = gen_model.generate_content(inputs, generation_config=generation_config)
131
  response_text = warning
132
  response_images = []
133
 
 
54
  def chat_submit_func(message, files, chat_history, model, temperature, top_p, max_tokens, api_key):
55
  print(model)
56
  client = genai.Client(api_key=api_key)
 
57
 
58
  # Prepare inputs
59
  if model_types[model] == "text" and files:
 
72
  }
73
 
74
  try:
75
+ response = client.models.generate_content(inputs, model=model, generation_config=generation_config)
76
  response_text = ""
77
  response_images = []
78
 
 
106
  def single_submit_func(prompt, files, model, temperature, top_p, max_tokens, api_key):
107
  print(model)
108
  client = genai.Client(api_key=api_key)
 
109
 
110
  # Prepare inputs
111
  if model_types[model] == "text" and files:
 
125
  }
126
 
127
  try:
128
+ response = client.models.generate_content(inputs, model=model, generation_config=generation_config)
129
  response_text = warning
130
  response_images = []
131