IST199655
commited on
Commit
·
192eae5
1
Parent(s):
24cfe65
- app.py +5 -0
- requirements.txt +0 -4
app.py
CHANGED
|
@@ -4,6 +4,11 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
"""
|
| 5 |
Copied from inference in colab notebook
|
| 6 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from unsloth.chat_templates import get_chat_template
|
| 8 |
from unsloth import FastLanguageModel
|
| 9 |
|
|
|
|
| 4 |
"""
|
| 5 |
Copied from inference in colab notebook
|
| 6 |
"""
|
| 7 |
+
import torch
|
| 8 |
+
|
| 9 |
+
# Monkey-patch to avoid CUDA initialization issues
|
| 10 |
+
torch.cuda.get_device_capability = lambda *args, **kwargs: (0, 0)
|
| 11 |
+
|
| 12 |
from unsloth.chat_templates import get_chat_template
|
| 13 |
from unsloth import FastLanguageModel
|
| 14 |
|
requirements.txt
CHANGED
|
@@ -1,7 +1,3 @@
|
|
| 1 |
huggingface_hub==0.25.2
|
| 2 |
|
| 3 |
-
torch==2.0.1
|
| 4 |
-
torchvision==0.15.2
|
| 5 |
-
-f https://download.pytorch.org/whl/cpu
|
| 6 |
-
|
| 7 |
unsloth
|
|
|
|
| 1 |
huggingface_hub==0.25.2
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
unsloth
|