Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,9 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
14 |
model = model.to(device)
|
15 |
|
16 |
|
|
|
|
|
|
|
17 |
# Defining a custom stopping criteria class for the model's text generation.
|
18 |
class StopOnTokens(StoppingCriteria):
|
19 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|
|
|
14 |
model = model.to(device)
|
15 |
|
16 |
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
# Defining a custom stopping criteria class for the model's text generation.
|
21 |
class StopOnTokens(StoppingCriteria):
|
22 |
def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor, **kwargs) -> bool:
|