Spaces:
Sleeping
Sleeping
fix(retrained_distilbert): Fix for tensor memory leaks
Browse files
src/graph/__pycache__/state_vector_nodes.cpython-312.pyc
CHANGED
|
Binary files a/src/graph/__pycache__/state_vector_nodes.cpython-312.pyc and b/src/graph/__pycache__/state_vector_nodes.cpython-312.pyc differ
|
|
|
src/graph/state_vector_nodes.py
CHANGED
|
@@ -135,7 +135,7 @@ class research_model:
|
|
| 135 |
tavily = TavilySearch(max_results=5, include_answer=True, include_snippet=True, include_source=True)
|
| 136 |
result = tavily.invoke(query)
|
| 137 |
answer=result['answer']
|
| 138 |
-
response="Summary Answer for all webpages: {answer} \n"
|
| 139 |
for r in result['results']:
|
| 140 |
response +="Found a webpage: %s at %s \n" %(r['title'], r['url'])
|
| 141 |
response +="Summary of the page: %s \n" %r['content']
|
|
|
|
| 135 |
tavily = TavilySearch(max_results=5, include_answer=True, include_snippet=True, include_source=True)
|
| 136 |
result = tavily.invoke(query)
|
| 137 |
answer=result['answer']
|
| 138 |
+
response=f"Summary Answer for all webpages: {answer} \n"
|
| 139 |
for r in result['results']:
|
| 140 |
response +="Found a webpage: %s at %s \n" %(r['title'], r['url'])
|
| 141 |
response +="Summary of the page: %s \n" %r['content']
|
src/streamlit_app.py
CHANGED
|
@@ -99,7 +99,7 @@ if __name__=='__main__':
|
|
| 99 |
LLM_Selection=ModelSelection(user_input)
|
| 100 |
if user_input["GENAI_API_KEY"]:llm=LLM_Selection.setup_llm_model()
|
| 101 |
loaded_tokenizer = AutoTokenizer.from_pretrained('src/train_bert/topic_classifier_model')
|
| 102 |
-
loaded_model = AutoModelForSequenceClassification.from_pretrained('src/train_bert/topic_classifier_model'
|
| 103 |
df_keys=pd.read_csv('src/train_bert/training_data/Keyword_Patterns.csv')
|
| 104 |
|
| 105 |
if not user_input:
|
|
|
|
| 99 |
LLM_Selection=ModelSelection(user_input)
|
| 100 |
if user_input["GENAI_API_KEY"]:llm=LLM_Selection.setup_llm_model()
|
| 101 |
loaded_tokenizer = AutoTokenizer.from_pretrained('src/train_bert/topic_classifier_model')
|
| 102 |
+
loaded_model = AutoModelForSequenceClassification.from_pretrained('src/train_bert/topic_classifier_model').to_empty(device='cpu')
|
| 103 |
df_keys=pd.read_csv('src/train_bert/training_data/Keyword_Patterns.csv')
|
| 104 |
|
| 105 |
if not user_input:
|