BivinSadler commited on
Commit
2f6e602
Β·
verified Β·
1 Parent(s): 43a60c8

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -19,15 +19,15 @@ os.environ["OPENAI_API_KEY"] = "your-key-here"
19
  llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)
20
 
21
  # βœ… Load HF model with preloaded config
 
 
22
  model_id = "BivinSadler/llama3-finetuned-Statistics"
23
- config = AutoConfig.from_pretrained(model_id, trust_remote_code=True,use_fast=False)
24
- general_stat_agent = pipeline(
25
- "text2text-generation",
26
- model=model_id,
27
- tokenizer=model_id,
28
- config=config,
29
- trust_remote_code=True
30
- )
31
 
32
  # βœ… Function to build a RAG agent from a PDF
33
  def build_rag_agent(pdf_path):
 
19
  llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0)
20
 
21
  # βœ… Load HF model with preloaded config
22
+ from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM
23
+
24
  model_id = "BivinSadler/llama3-finetuned-Statistics"
25
+
26
+ tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
27
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
28
+
29
+ general_stat_agent = pipeline("text2text-generation", model=model, tokenizer=tokenizer)
30
+
 
 
31
 
32
  # βœ… Function to build a RAG agent from a PDF
33
  def build_rag_agent(pdf_path):