remove check for env
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ from langchain.schema import AIMessage, HumanMessage, SystemMessage
|
|
10 |
import streamlit as st
|
11 |
from dotenv import load_dotenv
|
12 |
import PyPDF2
|
13 |
-
import os
|
14 |
|
15 |
load_dotenv()
|
16 |
|
@@ -25,13 +24,13 @@ class LegalExpert:
|
|
25 |
[self.system_prompt, self.user_prompt]
|
26 |
)
|
27 |
|
28 |
-
# create llm from huggingfaceHub model
|
29 |
-
if not os.getenv("HUGGINGFACE_API_KEY"):
|
30 |
-
raise ValueError("HUGGINGFACE_API_KEY not set")
|
31 |
self.llm = HuggingFaceHub(repo_id="google/flan-t5-xl",
|
32 |
model_kwargs={"temperature":0.3,
|
33 |
"max_length":64})
|
34 |
|
|
|
|
|
35 |
self.chain = LLMChain(llm=self.llm, prompt=full_prompt_template)
|
36 |
|
37 |
def get_system_prompt(self):
|
|
|
10 |
import streamlit as st
|
11 |
from dotenv import load_dotenv
|
12 |
import PyPDF2
|
|
|
13 |
|
14 |
load_dotenv()
|
15 |
|
|
|
24 |
[self.system_prompt, self.user_prompt]
|
25 |
)
|
26 |
|
27 |
+
# create llm from huggingfaceHub model
|
|
|
|
|
28 |
self.llm = HuggingFaceHub(repo_id="google/flan-t5-xl",
|
29 |
model_kwargs={"temperature":0.3,
|
30 |
"max_length":64})
|
31 |
|
32 |
+
# self.chat = ChatAnthropic()
|
33 |
+
|
34 |
self.chain = LLMChain(llm=self.llm, prompt=full_prompt_template)
|
35 |
|
36 |
def get_system_prompt(self):
|