rajeshlion commited on
Commit
e87c84a
·
verified ·
1 Parent(s): e0d1048

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -15
app.py CHANGED
@@ -43,20 +43,20 @@ class cbfs:
43
  # Select model dynamically
44
  if model_name == "GPT-4":
45
  chosen_llm = ChatOpenAI(model_name="gpt-4-1106-preview", temperature=0)
46
- elif model_name == "GPT-3.5":
47
- chosen_llm = ChatOpenAI(model_name="gpt-3.5-turbo-0125", temperature=0)
48
- elif model_name == "Llama-3 8B":
49
- chosen_llm = ChatOpenRouter(model_name="meta-llama/llama-3-8b-instruct", temperature=0)
50
- elif model_name == "Gemini-1.5 Pro":
51
- chosen_llm = ChatOpenRouter(model_name="google/gemini-pro-1.5", temperature=0)
52
- elif model_name == "Claude 3 Sonnet":
53
- chosen_llm = ChatOpenRouter(model_name='anthropic/claude-3-sonnet', temperature=0)
54
- elif model_name == "Claude 3.5 Sonnet":
55
- chosen_llm = ChatOpenRouter(model_name='anthropic/claude-3.5-sonnet', temperature=0)
56
- else:
57
  # Default model
58
- chosen_llm = ChatOpenRouter(model_name="meta-llama/llama-3-70b-instruct", temperature=0)
59
- # chosen_llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)
60
 
61
  self.qa = ConversationalRetrievalChain.from_llm(
62
  llm=chosen_llm,
@@ -122,8 +122,10 @@ with gr.Blocks() as demo:
122
 
123
  with gr.Row():
124
  db_choice = gr.Dropdown(["Covenants", "Bylaws"], label="Select Document", scale=1)
125
- model_choice = gr.Dropdown(["GPT-3.5", "GPT-4", "Llama-3 70B", "Llama-3 8B", "Gemini-1.5 Pro", "Claude 3 Sonnet", "Claude 3.5 Sonnet"],
126
- label="Select Model", scale=1, value = "Llama-3 70B")
 
 
127
  button_clearhistory = gr.Button("Clear History", scale=1)
128
 
129
  with gr.Row():
 
43
  # Select model dynamically
44
  if model_name == "GPT-4":
45
  chosen_llm = ChatOpenAI(model_name="gpt-4-1106-preview", temperature=0)
46
+ # elif model_name == "GPT-3.5":
47
+ # chosen_llm = ChatOpenAI(model_name="gpt-3.5-turbo-0125", temperature=0)
48
+ # elif model_name == "Llama-3 8B":
49
+ # chosen_llm = ChatOpenRouter(model_name="meta-llama/llama-3-8b-instruct", temperature=0)
50
+ # elif model_name == "Gemini-1.5 Pro":
51
+ # chosen_llm = ChatOpenRouter(model_name="google/gemini-pro-1.5", temperature=0)
52
+ # elif model_name == "Claude 3 Sonnet":
53
+ # chosen_llm = ChatOpenRouter(model_name='anthropic/claude-3-sonnet', temperature=0)
54
+ # elif model_name == "Claude 3.5 Sonnet":
55
+ # chosen_llm = ChatOpenRouter(model_name='anthropic/claude-3.5-sonnet', temperature=0)
56
+ # else:
57
  # Default model
58
+ # chosen_llm = ChatOpenRouter(model_name="meta-llama/llama-3-70b-instruct", temperature=0)
59
+ chosen_llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)
60
 
61
  self.qa = ConversationalRetrievalChain.from_llm(
62
  llm=chosen_llm,
 
122
 
123
  with gr.Row():
124
  db_choice = gr.Dropdown(["Covenants", "Bylaws"], label="Select Document", scale=1)
125
+ # model_choice = gr.Dropdown(["GPT-3.5", "GPT-4", "Llama-3 70B", "Llama-3 8B", "Gemini-1.5 Pro", "Claude 3 Sonnet", "Claude 3.5 Sonnet"],
126
+ # label="Select Model", scale=1, value = "Llama-3 70B")
127
+ model_choice = gr.Dropdown(["GPT-3.5", "GPT-4"],
128
+ label="Select Model", scale=1, value = "GPT-3.5")
129
  button_clearhistory = gr.Button("Clear History", scale=1)
130
 
131
  with gr.Row():