Spaces:
Sleeping
Sleeping
Commit ·
3931752
1
Parent(s): ff767c9
Initial commit from Gitpod
Browse files
app.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
os.makedirs("/tmp/huggingface", exist_ok=True)
|
| 7 |
os.makedirs("/tmp/mplconfig", exist_ok=True)
|
|
@@ -11,6 +12,7 @@ os.makedirs("/tmp/mplconfig", exist_ok=True)
|
|
| 11 |
|
| 12 |
from fastapi import FastAPI, HTTPException
|
| 13 |
from pydantic import BaseModel
|
|
|
|
| 14 |
from fastapi.responses import StreamingResponse
|
| 15 |
import matplotlib.pyplot as plt
|
| 16 |
import requests
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
os.environ["HF_HOME"] = "/tmp/huggingface"
|
| 4 |
+
os.environ["TRANSFORMERS_CACHE"] = "/tmp/huggingface"
|
| 5 |
+
os.environ["MPLCONFIGDIR"] = "/tmp/mplconfig"
|
| 6 |
|
| 7 |
os.makedirs("/tmp/huggingface", exist_ok=True)
|
| 8 |
os.makedirs("/tmp/mplconfig", exist_ok=True)
|
|
|
|
| 12 |
|
| 13 |
from fastapi import FastAPI, HTTPException
|
| 14 |
from pydantic import BaseModel
|
| 15 |
+
from transformers import pipeline
|
| 16 |
from fastapi.responses import StreamingResponse
|
| 17 |
import matplotlib.pyplot as plt
|
| 18 |
import requests
|