Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ import os
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
8 |
-
# Initialize LLM Lingua
|
9 |
-
compressor = PromptCompressor()
|
10 |
|
11 |
class TextInput(BaseModel):
|
12 |
text: str
|
@@ -24,4 +24,4 @@ async def compress_text(input: TextInput):
|
|
24 |
|
25 |
if __name__ == "__main__":
|
26 |
import uvicorn
|
27 |
-
uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 7860)))
|
|
|
5 |
|
6 |
app = FastAPI()
|
7 |
|
8 |
+
# Initialize LLM Lingua with CPU
|
9 |
+
compressor = PromptCompressor( device_map="auto") # or set device_map=None
|
10 |
|
11 |
class TextInput(BaseModel):
|
12 |
text: str
|
|
|
24 |
|
25 |
if __name__ == "__main__":
|
26 |
import uvicorn
|
27 |
+
uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 7860)))
|