Spaces:
Runtime error
Runtime error
Nattapong Tapachoom
commited on
Commit
Β·
3c5be17
1
Parent(s):
8eafcb6
Remove unused Ollama client code
Browse files
app.py
CHANGED
|
@@ -20,12 +20,6 @@ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, trust_remote_code=True)
|
|
| 20 |
model = AutoModel.from_pretrained(MODEL_NAME, _attn_implementation='flash_attention_2', torch_dtype=torch.bfloat16, trust_remote_code=True, use_safetensors=True)
|
| 21 |
model = model.eval().to('cuda' if torch.cuda.is_available() else 'cpu')
|
| 22 |
|
| 23 |
-
# Initialize Ollama client
|
| 24 |
-
if os.environ.get('OLLAMA_API_KEY'):
|
| 25 |
-
ollama_client = Client(host="https://ollama.com", headers={'Authorization': f'Bearer {os.environ.get("OLLAMA_API_KEY")}'})
|
| 26 |
-
else:
|
| 27 |
-
ollama_client = Client()
|
| 28 |
-
|
| 29 |
MODEL_CONFIGS = {
|
| 30 |
"Gundam": {"base_size": 1024, "image_size": 640, "crop_mode": True},
|
| 31 |
"Tiny": {"base_size": 512, "image_size": 512, "crop_mode": False},
|
|
|
|
| 20 |
model = AutoModel.from_pretrained(MODEL_NAME, _attn_implementation='flash_attention_2', torch_dtype=torch.bfloat16, trust_remote_code=True, use_safetensors=True)
|
| 21 |
model = model.eval().to('cuda' if torch.cuda.is_available() else 'cpu')
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
MODEL_CONFIGS = {
|
| 24 |
"Gundam": {"base_size": 1024, "image_size": 640, "crop_mode": True},
|
| 25 |
"Tiny": {"base_size": 512, "image_size": 512, "crop_mode": False},
|