Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,15 +1,9 @@
|
|
| 1 |
-
import os
|
| 2 |
import gradio as gr
|
| 3 |
-
import
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
-
|
| 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):
|