Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,8 @@ from transformers import StoppingCriteria, TextIteratorStreamer, StoppingCriteri
|
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
-
model = AutoModel.from_pretrained("unum-cloud/uform-gen2-qwen-
|
12 |
-
processor = AutoProcessor.from_pretrained("unum-cloud/uform-gen2-qwen-
|
13 |
|
14 |
class StopOnTokens(StoppingCriteria):
|
15 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|
|
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
+
model = AutoModel.from_pretrained("unum-cloud/uform-gen2-qwen-500m", trust_remote_code=True).to(device)
|
12 |
+
processor = AutoProcessor.from_pretrained("unum-cloud/uform-gen2-qwen-500m", trust_remote_code=True)
|
13 |
|
14 |
class StopOnTokens(StoppingCriteria):
|
15 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|