Josebert commited on
Commit
da635f0
·
verified ·
1 Parent(s): 59f597a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -1,15 +1,9 @@
1
- import os
2
  import gradio as gr
3
- import requests
4
 
5
- # Retrieve the API token from environment variables
6
- model_repo_id = os.getenv("MODEL_REPO_ID")
7
- if not model_repo_id:
8
- raise ValueError("MODEL_REPO_ID token not found. Please set the MODEL_REPO_ID environment variable.")
9
-
10
- # Hugging Face Inference API Details
11
- API_URL = "https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-1B-Instruct"
12
- HEADERS = {"Authorization": f"Bearer {model_repo_id}"}
13
 
14
 
15
  def generate_exegesis(passage):
 
 
1
  import gradio as gr
2
+ from transformers import AutoTokenizer, AutoModelForCausalLM
3
 
4
+ # Load model directly
5
+ tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-1B-Instruct")
6
+ model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-1B-Instruct")
 
 
 
 
 
7
 
8
 
9
  def generate_exegesis(passage):