Spaces:
Sleeping
Sleeping
acharyaaditya26
commited on
Commit
•
a51d495
1
Parent(s):
b00d723
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
|
2 |
from typing import List
|
3 |
from pydantic import BaseModel
|
@@ -5,6 +7,13 @@ from PIL import Image
|
|
5 |
import io
|
6 |
from transformers import AutoModel, AutoTokenizer
|
7 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
app = FastAPI()
|
10 |
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
from fastapi import FastAPI, File, UploadFile, Form, HTTPException
|
4 |
from typing import List
|
5 |
from pydantic import BaseModel
|
|
|
7 |
import io
|
8 |
from transformers import AutoModel, AutoTokenizer
|
9 |
import torch
|
10 |
+
from huggingface_hub import login
|
11 |
+
from dotenv import load_dotenv
|
12 |
+
load_dotenv()
|
13 |
+
|
14 |
+
api_key = os.getenv("HF_TOKEN")
|
15 |
+
|
16 |
+
login(token = api_key)
|
17 |
|
18 |
app = FastAPI()
|
19 |
|