Aliya05 commited on
Commit
e8185ec
·
verified ·
1 Parent(s): 96c9f81

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from langchain_groq import ChatGroq
3
+
4
+ from langchain.prompts import PromptTemplate
5
+
6
+ st.title('AI Scientist')
7
+ st.subheader('Here you will find solution for your problem')
8
+
9
+ model=ChatGroq(temperature=0.6,
10
+ groq_api_key='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',
11
+ model_name="llama-3.1-70b-versatile")
12
+
13
+ A=st.text_input('ENTER YOUR PROBLEM')
14
+
15
+ SUB=st.button('SUBMIT')
16
+
17
+ B=PromptTemplate(input=['C'],
18
+ template="""you are a highest ranked scientist working in Harvard University for more than 30 years,
19
+ you know every concepts and reactions in science,now tell me about {C} in 20 words and suggest an alternate for it in 20 words.""")
20
+ if SUB:
21
+ D=B.format(C=A)
22
+ response=model.invoke(D)
23
+ st.write(response.content)