cjell commited on
Commit
4a3e340
·
1 Parent(s): b022b26

using tmp

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. test.py +7 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import os
2
- os.environ["TRANSFORMERS_CACHE"] = "/code/.cache"
 
3
 
4
  from fastapi import FastAPI
5
  from pydantic import BaseModel
 
1
  import os
2
+ # Use HF_HOME instead of TRANSFORMERS_CACHE, and point it to /tmp
3
+ os.environ["HF_HOME"] = "/tmp"
4
 
5
  from fastapi import FastAPI
6
  from pydantic import BaseModel
test.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ import requests
2
+
3
+ resp = requests.post(
4
+ "https://cjell-spam-fastapi.hf.space/predict",
5
+ json={"text": "Congratulations! You've won a free cruise, click here!"}
6
+ )
7
+ print(resp.json())