pentarosarium commited on
Commit
27a89df
·
verified ·
1 Parent(s): c06805c

Upload 2 files

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -2,13 +2,15 @@ import streamlit as st
2
  import fitz # PyMuPDF for PDF processing
3
  import pandas as pd
4
  from transformers import pipeline
 
5
 
6
-
 
7
 
8
  # Load the model (Meta-Llama 3.1 8B)
9
  @st.cache_resource
10
  def load_model():
11
- model = pipeline("text2text-generation", model="meta-llama/Meta-Llama-3.1-8B-Instruct", use_auth_token=True)
12
  return model
13
 
14
  model = load_model()
 
2
  import fitz # PyMuPDF for PDF processing
3
  import pandas as pd
4
  from transformers import pipeline
5
+ import os
6
 
7
+ # Get the Hugging Face token from the environment variables
8
+ hf_token = os.getenv("HF_API_TOKEN")
9
 
10
  # Load the model (Meta-Llama 3.1 8B)
11
  @st.cache_resource
12
  def load_model():
13
+ model = pipeline("text2text-generation", model="meta-llama/Meta-Llama-3.1-8B-Instruct", use_auth_token=hf_token)
14
  return model
15
 
16
  model = load_model()