Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
3 |
from peft import PeftModel
|
4 |
import torch
|
5 |
import os
|
|
|
6 |
|
7 |
"""
|
8 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
@@ -13,6 +14,8 @@ API_KEY = os.environ.get("ACESS_TOKEN")
|
|
13 |
BASE_MODEL = "mistralai/Mistral-7B-v0.1"
|
14 |
PEFT_ADAPTER = "asdc/Mistral-7B-multilingual-temporal-expression-normalization"
|
15 |
|
|
|
|
|
16 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, token=API_KEY)
|
17 |
base_model = AutoModelForCausalLM.from_pretrained(
|
18 |
BASE_MODEL,
|
|
|
3 |
from peft import PeftModel
|
4 |
import torch
|
5 |
import os
|
6 |
+
from huggingface_hub import login
|
7 |
|
8 |
"""
|
9 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
|
|
14 |
BASE_MODEL = "mistralai/Mistral-7B-v0.1"
|
15 |
PEFT_ADAPTER = "asdc/Mistral-7B-multilingual-temporal-expression-normalization"
|
16 |
|
17 |
+
login(token=API_KEY)
|
18 |
+
|
19 |
tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL, token=API_KEY)
|
20 |
base_model = AutoModelForCausalLM.from_pretrained(
|
21 |
BASE_MODEL,
|