Divyansh Kushwaha commited on
Commit
ee7b40b
·
1 Parent(s): 0c4bb07
Files changed (2) hide show
  1. app.py +4 -9
  2. requirements.txt +3 -2
app.py CHANGED
@@ -1,18 +1,13 @@
1
  import streamlit as st
2
- from langchain_groq import ChatGroq
3
- from dotenv import load_dotenv
4
- import os
5
- load_dotenv()
6
- GROQ_API_KEY= os.getenv('GROQ_API_KEY')
7
-
8
- llm = ChatGroq(api_key=GROQ_API_KEY, model="llama-3.1-8b-instant")
9
 
 
10
  # Streamlit UI
11
- st.title("Groq AI Chatbot")
12
  st.write("Enter your message below:")
13
 
14
  user_input = st.text_input("You:", "")
15
 
16
  if st.button("Submit") and user_input:
17
- response = llm.invoke(user_input).content
18
  st.text_area("Groq AI:", response, height=200)
 
1
  import streamlit as st
2
+ from transformers import pipeline
 
 
 
 
 
 
3
 
4
+ pipe = pipeline("text-classification", model="tabularisai/multilingual-sentiment-analysis",device=1)
5
  # Streamlit UI
6
+ st.title("Sentiment analyzer")
7
  st.write("Enter your message below:")
8
 
9
  user_input = st.text_input("You:", "")
10
 
11
  if st.button("Submit") and user_input:
12
+ response = pipe(user_input)[0]
13
  st.text_area("Groq AI:", response, height=200)
requirements.txt CHANGED
@@ -1,5 +1,6 @@
1
  streamlit
2
  requests
3
- langchain_groq
4
- langchain
5
  python-dotenv
 
 
 
1
  streamlit
2
  requests
3
+
 
4
  python-dotenv
5
+ transformers
6
+ torch