Spaces:
Running
Running
Sets the TRANSFORMERS_CACHE environment variable as a fallback
Browse files
app.py
CHANGED
@@ -1,6 +1,10 @@
|
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
|
|
4 |
app = FastAPI()
|
5 |
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
6 |
|
|
|
1 |
+
import os
|
2 |
from fastapi import FastAPI
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
# Set a custom Hugging Face cache directory
|
6 |
+
os.environ["TRANSFORMERS_CACHE"] = "/app/.cache"
|
7 |
+
|
8 |
app = FastAPI()
|
9 |
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
10 |
|