Spaces:
Sleeping
Sleeping
Commit
·
3f2f8aa
1
Parent(s):
9e8b261
Inferenced the gpt-4o-mini model
Browse files- main.py +1 -3
- requirements.txt +1 -0
- utils/models_loader.py +9 -1
main.py
CHANGED
|
@@ -21,7 +21,7 @@ business_interaction_graph = BusinessInteractionChatbot()
|
|
| 21 |
brainstrom_graph = brainstroming_graph()
|
| 22 |
|
| 23 |
stored_data={}
|
| 24 |
-
|
| 25 |
|
| 26 |
class UserMessage(BaseModel):
|
| 27 |
message: str
|
|
@@ -46,8 +46,6 @@ def context_analysis(msg: UserMessage):
|
|
| 46 |
@app.post("/business-interaction")
|
| 47 |
def business_interaction(interaction: str):
|
| 48 |
response,business_details = business_interaction_graph.chat(interaction , stored_data['business_details'])
|
| 49 |
-
if stored_data['business_details']!=business_details:
|
| 50 |
-
save_to_db(business_details)
|
| 51 |
stored_data['business_details']=business_details
|
| 52 |
return {'response': response}
|
| 53 |
|
|
|
|
| 21 |
brainstrom_graph = brainstroming_graph()
|
| 22 |
|
| 23 |
stored_data={}
|
| 24 |
+
stored_data['business_details']={"business_type": "restaurant", "platform": "instagram", "target_audience": "youths", "business_goals": "to go global", "offerings": "nepali foods", "Challenges_faced": "finding new customers, attracting large customers"}
|
| 25 |
|
| 26 |
class UserMessage(BaseModel):
|
| 27 |
message: str
|
|
|
|
| 46 |
@app.post("/business-interaction")
|
| 47 |
def business_interaction(interaction: str):
|
| 48 |
response,business_details = business_interaction_graph.chat(interaction , stored_data['business_details'])
|
|
|
|
|
|
|
| 49 |
stored_data['business_details']=business_details
|
| 50 |
return {'response': response}
|
| 51 |
|
requirements.txt
CHANGED
|
@@ -14,4 +14,5 @@ python-multipart
|
|
| 14 |
langmem
|
| 15 |
streamlit
|
| 16 |
requests
|
|
|
|
| 17 |
|
|
|
|
| 14 |
langmem
|
| 15 |
streamlit
|
| 16 |
requests
|
| 17 |
+
langchain_openai
|
| 18 |
|
utils/models_loader.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from langchain_groq import ChatGroq
|
|
|
|
| 2 |
from sentence_transformers import SentenceTransformer
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
from huggingface_hub import login
|
|
@@ -15,11 +16,18 @@ os.environ['GROQ_API_KEY']=os.getenv('GROQ_API_KEY')
|
|
| 15 |
|
| 16 |
llm = ChatGroq(
|
| 17 |
model="llama-3.3-70b-versatile",
|
| 18 |
-
temperature=0,
|
| 19 |
max_tokens=500,
|
| 20 |
|
| 21 |
)
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
class HFEmbeddingAPI:
|
| 24 |
def __init__(self, api_url, token):
|
| 25 |
self.api_url = api_url
|
|
|
|
| 1 |
from langchain_groq import ChatGroq
|
| 2 |
+
from langchain_openai import ChatOpenAI
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
from huggingface_hub import InferenceClient
|
| 5 |
from huggingface_hub import login
|
|
|
|
| 16 |
|
| 17 |
llm = ChatGroq(
|
| 18 |
model="llama-3.3-70b-versatile",
|
| 19 |
+
temperature=0.3,
|
| 20 |
max_tokens=500,
|
| 21 |
|
| 22 |
)
|
| 23 |
|
| 24 |
+
# llm = ChatOpenAI(
|
| 25 |
+
# model="gpt-4o-mini",
|
| 26 |
+
# temperature=0,
|
| 27 |
+
# max_tokens=500,
|
| 28 |
+
# )
|
| 29 |
+
|
| 30 |
+
|
| 31 |
class HFEmbeddingAPI:
|
| 32 |
def __init__(self, api_url, token):
|
| 33 |
self.api_url = api_url
|