Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# 加载模型和分词器
|
6 |
model_name = "taide/Llama3-TAIDE-LX-8B-Chat-Alpha1"
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
3 |
import torch
|
4 |
+
from huggingface_hub import login
|
5 |
+
import os
|
6 |
+
|
7 |
+
# 从 Hugging Face Secrets 中读取 Token
|
8 |
+
token = os.getenv("HUGGINGFACE_API_TOKEN")
|
9 |
+
|
10 |
+
# 登录 Hugging Face 账户
|
11 |
+
login(token=token)
|
12 |
|
13 |
# 加载模型和分词器
|
14 |
model_name = "taide/Llama3-TAIDE-LX-8B-Chat-Alpha1"
|