giulia-fontanella commited on
Commit
c4e80a4
·
verified ·
1 Parent(s): 0745f60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -37,18 +37,22 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
37
 
38
  # 1. Instantiate Agent
39
  try:
40
- if PROVIDER_TYPE=="huggingface":
41
  llm = HuggingFaceEndpoint(
42
  repo_id=REPO_ID,
43
  huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
44
  )
45
  chat = ChatHuggingFace(llm=llm, verbose=True)
46
- elif PROVIDER_TYPE=="openai":
47
  chat = ChatOpenAI(model="gpt-4o")
48
  else:
49
  print(f"Provider {PROVIDER_TYPE} not supported.")
50
  return f"Provider {PROVIDER_TYPE} not supported", None
51
- agent = BasicAgent(chat)
 
 
 
 
52
 
53
  except Exception as e:
54
  print(f"Error instantiating agent: {e}")
 
37
 
38
  # 1. Instantiate Agent
39
  try:
40
+ if PROVIDER_TYPE == "huggingface":
41
  llm = HuggingFaceEndpoint(
42
  repo_id=REPO_ID,
43
  huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
44
  )
45
  chat = ChatHuggingFace(llm=llm, verbose=True)
46
+ elif PROVIDER_TYPE == "openai":
47
  chat = ChatOpenAI(model="gpt-4o")
48
  else:
49
  print(f"Provider {PROVIDER_TYPE} not supported.")
50
  return f"Provider {PROVIDER_TYPE} not supported", None
51
+ if include_vision == True:
52
+ vision_llm = ChatOpenAI(model="gpt-4o")
53
+ else:
54
+ vision_llm = None
55
+ agent = BasicAgent(chat, vision_llm)
56
 
57
  except Exception as e:
58
  print(f"Error instantiating agent: {e}")