Spaces:
Sleeping
Sleeping
Upload 2 files
Browse filesadjusting the versions in requirements.txt
eliminating examples from gradio interface (temporarily)
- app.py +16 -7
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -37,9 +37,9 @@ hf_space_dir = os.getcwd()
|
|
| 37 |
# Set your API key from an environment variable: get("OPENAI_API_KEY")
|
| 38 |
# environ is a dictionary with all the environment variables, so to access the value, provide the key
|
| 39 |
# app.py should have access to the OpenAI key stored as a HuggingFace secret in the HuggingFace space where the app.py will be uploaded, by accessing it through the environment variables
|
| 40 |
-
|
| 41 |
# or:
|
| 42 |
-
openai_api_key = os.environ.get("OpenAI_API_key_GL_Adv_Python_Project")
|
| 43 |
# or:
|
| 44 |
# openai_api_key = os.environ("OpenAI_API_key_GL_Adv_Python_Project") # this produces error while "starting" app.py in HuggingFace: TypeError: '_Environ' object is not callable
|
| 45 |
|
|
@@ -171,13 +171,22 @@ demo = gr.Interface(
|
|
| 171 |
title="Ask Me Anything (AMA) on Tesla 10-K statements",
|
| 172 |
description="This web API presents an interface to ask questions on contents of the Tesla 10-K reports for the period 2019 - 2023.",
|
| 173 |
article="Note that questions that are not relevant to the Tesla 10-K report will not be answered.",
|
| 174 |
-
examples=[["What was the total revenue of the company in 2022?", "$ 81.46 Billion"],
|
| 175 |
-
["Summarize the Management Discussion and Analysis section of the 2021 report in 50 words.", ""],
|
| 176 |
-
["What was the company's debt level in 2020?", ""],
|
| 177 |
-
["Identify 5 key risks identified in the 2019 10k report? Respond with bullet point summaries.", ""]
|
| 178 |
-
],
|
| 179 |
concurrency_limit=16
|
| 180 |
)
|
| 181 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
demo.queue()
|
| 183 |
demo.launch()
|
|
|
|
| 37 |
# Set your API key from an environment variable: get("OPENAI_API_KEY")
|
| 38 |
# environ is a dictionary with all the environment variables, so to access the value, provide the key
|
| 39 |
# app.py should have access to the OpenAI key stored as a HuggingFace secret in the HuggingFace space where the app.py will be uploaded, by accessing it through the environment variables
|
| 40 |
+
openai_api_key = os.getenv("OpenAI_API_key_GL_Adv_Python_Project")
|
| 41 |
# or:
|
| 42 |
+
# openai_api_key = os.environ.get("OpenAI_API_key_GL_Adv_Python_Project")
|
| 43 |
# or:
|
| 44 |
# openai_api_key = os.environ("OpenAI_API_key_GL_Adv_Python_Project") # this produces error while "starting" app.py in HuggingFace: TypeError: '_Environ' object is not callable
|
| 45 |
|
|
|
|
| 171 |
title="Ask Me Anything (AMA) on Tesla 10-K statements",
|
| 172 |
description="This web API presents an interface to ask questions on contents of the Tesla 10-K reports for the period 2019 - 2023.",
|
| 173 |
article="Note that questions that are not relevant to the Tesla 10-K report will not be answered.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
concurrency_limit=16
|
| 175 |
)
|
| 176 |
|
| 177 |
+
|
| 178 |
+
# demo = gr.Interface(
|
| 179 |
+
# inputs=textbox, fn=predict, outputs="text",
|
| 180 |
+
# title="Ask Me Anything (AMA) on Tesla 10-K statements",
|
| 181 |
+
# description="This web API presents an interface to ask questions on contents of the Tesla 10-K reports for the period 2019 - 2023.",
|
| 182 |
+
# article="Note that questions that are not relevant to the Tesla 10-K report will not be answered.",
|
| 183 |
+
# examples=[["What was the total revenue of the company in 2022?", "$ 81.46 Billion"],
|
| 184 |
+
# ["Summarize the Management Discussion and Analysis section of the 2021 report in 50 words.", ""],
|
| 185 |
+
# ["What was the company's debt level in 2020?", ""],
|
| 186 |
+
# ["Identify 5 key risks identified in the 2019 10k report? Respond with bullet point summaries.", ""]
|
| 187 |
+
# ],
|
| 188 |
+
# concurrency_limit=16
|
| 189 |
+
# )
|
| 190 |
+
|
| 191 |
demo.queue()
|
| 192 |
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
openai==1.23.2
|
| 2 |
chromadb==0.4.22
|
| 3 |
-
langchain==0.1.
|
| 4 |
-
langchain-community==0.0.
|
| 5 |
sentence-transformers==2.3.1
|
|
|
|
| 1 |
openai==1.23.2
|
| 2 |
chromadb==0.4.22
|
| 3 |
+
langchain==0.1.1
|
| 4 |
+
langchain-community==0.0.13
|
| 5 |
sentence-transformers==2.3.1
|