dodany token
Browse files
app.py
CHANGED
@@ -2,11 +2,16 @@ import spaces
|
|
2 |
import gradio as gr
|
3 |
import transformers
|
4 |
import torch
|
|
|
|
|
5 |
|
6 |
model_id = "meta-llama/Meta-Llama-3.1-8B"
|
7 |
|
8 |
@spaces.GPU(duration=60)
|
9 |
def load_pipeline():
|
|
|
|
|
|
|
10 |
return transformers.pipeline(
|
11 |
"text-generation",
|
12 |
model=model_id,
|
|
|
2 |
import gradio as gr
|
3 |
import transformers
|
4 |
import torch
|
5 |
+
import os
|
6 |
+
from huggingface_hub import login
|
7 |
|
8 |
model_id = "meta-llama/Meta-Llama-3.1-8B"
|
9 |
|
10 |
@spaces.GPU(duration=60)
|
11 |
def load_pipeline():
|
12 |
+
# Zaloguj się używając tokena
|
13 |
+
login(token=os.environ.get("MY_API_LLAMA_3_1"))
|
14 |
+
|
15 |
return transformers.pipeline(
|
16 |
"text-generation",
|
17 |
model=model_id,
|