Spaces:
Runtime error
Runtime error
Yash Sachdeva
commited on
Commit
·
bff48c8
1
Parent(s):
8692992
question_paper
Browse files- question_paper.py +3 -2
question_paper.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import transformers
|
2 |
import torch
|
|
|
3 |
|
4 |
from fastapi import FastAPI
|
5 |
|
@@ -9,10 +10,10 @@ from transformers import AutoTokenizer
|
|
9 |
|
10 |
app = FastAPI()
|
11 |
model = "meta-llama/Llama-2-70b"
|
12 |
-
|
13 |
@app.get("/")
|
14 |
def llama():
|
15 |
-
tokenizer = AutoTokenizer.from_pretrained(model)
|
16 |
|
17 |
pipeline = transformers.pipeline("text-generation" ,model=model ,torch_dtype=torch.float16 ,device_map="auto" , )
|
18 |
|
|
|
1 |
import transformers
|
2 |
import torch
|
3 |
+
import os
|
4 |
|
5 |
from fastapi import FastAPI
|
6 |
|
|
|
10 |
|
11 |
app = FastAPI()
|
12 |
model = "meta-llama/Llama-2-70b"
|
13 |
+
access_token = os.getenv("access_token")
|
14 |
@app.get("/")
|
15 |
def llama():
|
16 |
+
tokenizer = AutoTokenizer.from_pretrained(model,token=access_token)
|
17 |
|
18 |
pipeline = transformers.pipeline("text-generation" ,model=model ,torch_dtype=torch.float16 ,device_map="auto" , )
|
19 |
|