update application file to include HF token
Browse files
app.py
CHANGED
|
@@ -2,6 +2,14 @@ import gradio as gr
|
|
| 2 |
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
|
| 3 |
import torch
|
| 4 |
import textwrap
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# π Load model and processor
|
| 7 |
model_id = "google/gemma-3n-e2b-it"
|
|
|
|
| 2 |
from transformers import AutoProcessor, Gemma3nForConditionalGeneration
|
| 3 |
import torch
|
| 4 |
import textwrap
|
| 5 |
+
from huggingface_hub import login
|
| 6 |
+
import os
|
| 7 |
+
|
| 8 |
+
# Log in using the HF token (automatically read from secret)
|
| 9 |
+
hf_token = os.getenv("HUGGINGFACE_HUB_TOKEN")
|
| 10 |
+
login(token=hf_token)
|
| 11 |
+
|
| 12 |
+
|
| 13 |
|
| 14 |
# π Load model and processor
|
| 15 |
model_id = "google/gemma-3n-e2b-it"
|