Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app.py +23 -0
- requirements.txt +78 -0
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain_openai import OpenAI
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
load_dotenv()
|
4 |
+
import os
|
5 |
+
|
6 |
+
import streamlit as st
|
7 |
+
|
8 |
+
api_key = os.getenv('open_ai_api')
|
9 |
+
|
10 |
+
|
11 |
+
def open_ai_responst(question):
|
12 |
+
llm=OpenAI(openai_api_key=api_key,model_name='gpt-3.5-turbo-instruct',temperature=0.6)
|
13 |
+
response=llm(question)
|
14 |
+
return response
|
15 |
+
|
16 |
+
st.set_page_config("Q&A")
|
17 |
+
st.header('langchain application')
|
18 |
+
input=st.text_input("input",key="input")
|
19 |
+
response=open_ai_responst(input)
|
20 |
+
submit_button=st.button('ask the question')
|
21 |
+
if submit_button:
|
22 |
+
st.subheader('response is :')
|
23 |
+
st.write(response)
|
requirements.txt
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
aiohttp==3.9.5
|
2 |
+
aiosignal==1.3.1
|
3 |
+
altair==5.3.0
|
4 |
+
annotated-types==0.7.0
|
5 |
+
anyio==4.4.0
|
6 |
+
async-timeout==4.0.3
|
7 |
+
attrs==23.2.0
|
8 |
+
blinker==1.8.2
|
9 |
+
cachetools==5.4.0
|
10 |
+
certifi==2024.7.4
|
11 |
+
charset-normalizer==3.3.2
|
12 |
+
click==8.1.7
|
13 |
+
dataclasses-json==0.6.7
|
14 |
+
distro==1.9.0
|
15 |
+
exceptiongroup==1.2.2
|
16 |
+
frozenlist==1.4.1
|
17 |
+
gitdb==4.0.11
|
18 |
+
GitPython==3.1.43
|
19 |
+
greenlet==3.0.3
|
20 |
+
h11==0.14.0
|
21 |
+
httpcore==1.0.5
|
22 |
+
httpx==0.27.0
|
23 |
+
idna==3.7
|
24 |
+
Jinja2==3.1.4
|
25 |
+
jsonpatch==1.33
|
26 |
+
jsonpointer==3.0.0
|
27 |
+
jsonschema==4.23.0
|
28 |
+
jsonschema-specifications==2023.12.1
|
29 |
+
langchain==0.2.11
|
30 |
+
langchain-community==0.2.10
|
31 |
+
langchain-core==0.2.23
|
32 |
+
langchain-openai==0.1.17
|
33 |
+
langchain-text-splitters==0.2.2
|
34 |
+
langsmith==0.1.93
|
35 |
+
markdown-it-py==3.0.0
|
36 |
+
MarkupSafe==2.1.5
|
37 |
+
marshmallow==3.21.3
|
38 |
+
mdurl==0.1.2
|
39 |
+
multidict==6.0.5
|
40 |
+
mypy-extensions==1.0.0
|
41 |
+
numpy==1.26.4
|
42 |
+
openai==1.37.1
|
43 |
+
orjson==3.10.6
|
44 |
+
packaging==24.1
|
45 |
+
pandas==2.2.2
|
46 |
+
pillow==10.4.0
|
47 |
+
protobuf==5.27.2
|
48 |
+
pyarrow==17.0.0
|
49 |
+
pydantic==2.8.2
|
50 |
+
pydantic_core==2.20.1
|
51 |
+
pydeck==0.9.1
|
52 |
+
Pygments==2.18.0
|
53 |
+
python-dateutil==2.9.0.post0
|
54 |
+
python-dotenv==1.0.1
|
55 |
+
pytz==2024.1
|
56 |
+
PyYAML==6.0.1
|
57 |
+
referencing==0.35.1
|
58 |
+
regex==2024.7.24
|
59 |
+
requests==2.32.3
|
60 |
+
rich==13.7.1
|
61 |
+
rpds-py==0.19.1
|
62 |
+
six==1.16.0
|
63 |
+
smmap==5.0.1
|
64 |
+
sniffio==1.3.1
|
65 |
+
SQLAlchemy==2.0.31
|
66 |
+
streamlit==1.37.0
|
67 |
+
tenacity==8.5.0
|
68 |
+
tiktoken==0.7.0
|
69 |
+
toml==0.10.2
|
70 |
+
toolz==0.12.1
|
71 |
+
tornado==6.4.1
|
72 |
+
tqdm==4.66.4
|
73 |
+
typing-inspect==0.9.0
|
74 |
+
typing_extensions==4.12.2
|
75 |
+
tzdata==2024.1
|
76 |
+
urllib3==2.2.2
|
77 |
+
watchdog==4.0.1
|
78 |
+
yarl==1.9.4
|