Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,18 @@ from datetime import datetime
|
|
| 5 |
import torch
|
| 6 |
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
|
| 7 |
import time
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
|
|
|
| 11 |
# Configuration
|
| 12 |
API_KEYS = {
|
| 13 |
-
|
| 14 |
}
|
| 15 |
|
| 16 |
# Initialize model and tokenizer with smaller model for Spaces
|
|
|
|
| 5 |
import torch
|
| 6 |
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
|
| 7 |
import time
|
| 8 |
+
#from dotenv import load_dotenv
|
| 9 |
+
import os
|
| 10 |
+
|
| 11 |
+
#load_dotenv()
|
| 12 |
|
| 13 |
app = FastAPI()
|
| 14 |
|
| 15 |
+
API_KEY = os.getenv("API_KEY")
|
| 16 |
+
|
| 17 |
# Configuration
|
| 18 |
API_KEYS = {
|
| 19 |
+
API_KEY : "user1" # In production, use a secure database
|
| 20 |
}
|
| 21 |
|
| 22 |
# Initialize model and tokenizer with smaller model for Spaces
|