Spaces:
Runtime error
Runtime error
Fixed missing space
Browse files- public_app.py +4 -4
public_app.py
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
import logging
|
| 2 |
import os
|
|
|
|
|
|
|
| 3 |
|
| 4 |
from langchain import PromptTemplate, LLMChain
|
| 5 |
from langchain.chains.question_answering import load_qa_chain
|
| 6 |
from langchain.vectorstores import FAISS
|
| 7 |
from langchain.embeddings import HuggingFaceEmbeddings
|
| 8 |
from langchain.chat_models import ChatOpenAI
|
| 9 |
-
import gradio as gr
|
| 10 |
-
import json
|
| 11 |
|
| 12 |
from prompts import PROMPT_EXTRACT_DATE, PROMPT_FED_ANALYST
|
| 13 |
from filterminutes import search_with_filter
|
|
@@ -24,7 +24,7 @@ PROMPT_DATE = PromptTemplate.from_template(PROMPT_EXTRACT_DATE)
|
|
| 24 |
PROMPT_ANALYST = PromptTemplate.from_template(PROMPT_FED_ANALYST)
|
| 25 |
|
| 26 |
|
| 27 |
-
# --------------------------
|
| 28 |
def load_chains(open_ai_key):
|
| 29 |
date_extractor = LLMChain(llm=ChatOpenAI(temperature=0, model_name='gpt-3.5-turbo', openai_api_key=open_ai_key),
|
| 30 |
prompt=PROMPT_DATE)
|
|
@@ -74,7 +74,7 @@ if __name__ == '__main__':
|
|
| 74 |
'Open Market Committee meetings from March 1936 to June 2023. Click the examples'
|
| 75 |
' below to see the tool in action.',
|
| 76 |
article='**Disclaimer**: This app is for demonstration purposes only, and answers may take some'
|
| 77 |
-
'time to complete'
|
| 78 |
'during periods of heavy usage. Please be patient :)',
|
| 79 |
analytics_enabled=True,
|
| 80 |
outputs=gr.Textbox(lines=1, label='Answer'),
|
|
|
|
| 1 |
import logging
|
| 2 |
import os
|
| 3 |
+
import json
|
| 4 |
+
import gradio as gr
|
| 5 |
|
| 6 |
from langchain import PromptTemplate, LLMChain
|
| 7 |
from langchain.chains.question_answering import load_qa_chain
|
| 8 |
from langchain.vectorstores import FAISS
|
| 9 |
from langchain.embeddings import HuggingFaceEmbeddings
|
| 10 |
from langchain.chat_models import ChatOpenAI
|
|
|
|
|
|
|
| 11 |
|
| 12 |
from prompts import PROMPT_EXTRACT_DATE, PROMPT_FED_ANALYST
|
| 13 |
from filterminutes import search_with_filter
|
|
|
|
| 24 |
PROMPT_ANALYST = PromptTemplate.from_template(PROMPT_FED_ANALYST)
|
| 25 |
|
| 26 |
|
| 27 |
+
# --------------------------Define the qa chain for answering queries--------------------------#
|
| 28 |
def load_chains(open_ai_key):
|
| 29 |
date_extractor = LLMChain(llm=ChatOpenAI(temperature=0, model_name='gpt-3.5-turbo', openai_api_key=open_ai_key),
|
| 30 |
prompt=PROMPT_DATE)
|
|
|
|
| 74 |
'Open Market Committee meetings from March 1936 to June 2023. Click the examples'
|
| 75 |
' below to see the tool in action.',
|
| 76 |
article='**Disclaimer**: This app is for demonstration purposes only, and answers may take some'
|
| 77 |
+
' time to complete'
|
| 78 |
'during periods of heavy usage. Please be patient :)',
|
| 79 |
analytics_enabled=True,
|
| 80 |
outputs=gr.Textbox(lines=1, label='Answer'),
|