Mystyc commited on
Commit
e2d23cd
·
1 Parent(s): 559b365

Revert last 2 commits

Browse files
Files changed (3) hide show
  1. __pycache__/app.cpython-311.pyc +0 -0
  2. app.py +1 -1
  3. tes.py +0 -13
__pycache__/app.cpython-311.pyc DELETED
Binary file (2.21 kB)
 
app.py CHANGED
@@ -5,7 +5,7 @@ from huggingface_hub import AsyncInferenceClient
5
 
6
  # Model Hugging Face untuk penghapusan background
7
  MODEL_ID = os.getenv("MODEL_ID", "briaai/RMBG-1.4")
8
- HF_TOKEN = os.getenv("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")
9
  client = AsyncInferenceClient(model=MODEL_ID, token=HF_TOKEN)
10
 
11
  app = FastAPI(title="Background Removal Proxy")
 
5
 
6
  # Model Hugging Face untuk penghapusan background
7
  MODEL_ID = os.getenv("MODEL_ID", "briaai/RMBG-1.4")
8
+ HF_TOKEN = os.getenv("HF_TOKEN")
9
  client = AsyncInferenceClient(model=MODEL_ID, token=HF_TOKEN)
10
 
11
  app = FastAPI(title="Background Removal Proxy")
tes.py DELETED
@@ -1,13 +0,0 @@
1
- import asyncio, io
2
- from PIL import Image
3
- from huggingface_hub import AsyncInferenceClient
4
-
5
- from app import HF_TOKEN, MODEL_ID
6
-
7
- async def main():
8
- client = AsyncInferenceClient(model=MODEL_ID, token=HF_TOKEN)
9
- with open("tes.png", "rb") as f:
10
- result = await client.image_to_image(f.read(), model=MODEL_ID)
11
- result.save("hasil.png", "PNG")
12
-
13
- asyncio.run(main())