Daksh0505 commited on
Commit
b0b5ef6
·
verified ·
1 Parent(s): dd60fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -82,8 +82,16 @@ def create_vector_store(transcript):
82
  return FAISS.from_documents(docs, load_embeddings())
83
 
84
  # 🤖 Model Builder
 
85
  def build_model(model_choice, temperature):
86
- repo_id = "deepseek-ai/DeepSeek-V3.2-Exp" if model_choice == "DeepSeek" else "openai/gpt-oss-20b"
 
 
 
 
 
 
 
87
  llm = HuggingFaceEndpoint(
88
  repo_id=repo_id,
89
  huggingfacehub_api_token=api_key,
@@ -91,6 +99,7 @@ def build_model(model_choice, temperature):
91
  )
92
  return ChatHuggingFace(llm=llm, temperature=temperature)
93
 
 
94
  # 🧾 Prompt Template
95
  prompt_template = PromptTemplate(
96
  template=(
@@ -123,7 +132,7 @@ selected_lang = st.selectbox("Transcript Language", lang_options)
123
  language_code = selected_lang.split("(")[-1].strip(")")
124
 
125
  query = st.text_area("Your Query", value="What is RAG?")
126
- model_choice = st.radio("Model to Use", ["DeepSeek", "OpenAI"])
127
  temperature = st.slider("Temperature", 0, 100, value=50)
128
 
129
  if st.button("🚀 Run Chatbot"):
 
82
  return FAISS.from_documents(docs, load_embeddings())
83
 
84
  # 🤖 Model Builder
85
+ # 🤖 Model Builder (with free model option)
86
  def build_model(model_choice, temperature):
87
+ if model_choice == "DeepSeek":
88
+ repo_id = "deepseek-ai/DeepSeek-V3.2-Exp" # paid
89
+ elif model_choice == "OpenAI":
90
+ repo_id = "openai/gpt-oss-20b" # paid
91
+ else:
92
+ # Free Hugging Face model
93
+ repo_id = "bigscience/bloom-560m" # free, smaller model
94
+
95
  llm = HuggingFaceEndpoint(
96
  repo_id=repo_id,
97
  huggingfacehub_api_token=api_key,
 
99
  )
100
  return ChatHuggingFace(llm=llm, temperature=temperature)
101
 
102
+
103
  # 🧾 Prompt Template
104
  prompt_template = PromptTemplate(
105
  template=(
 
132
  language_code = selected_lang.split("(")[-1].strip(")")
133
 
134
  query = st.text_area("Your Query", value="What is RAG?")
135
+ model_choice = st.radio("Model to Use", ["DeepSeek", "OpenAI", "Free HF Model"])
136
  temperature = st.slider("Temperature", 0, 100, value=50)
137
 
138
  if st.button("🚀 Run Chatbot"):