Crystalcareai
commited on
Update generate.py
Browse files- generate.py +8 -0
generate.py
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def custom_generate(
|
2 |
self,
|
3 |
input_ids,
|
|
|
1 |
+
import torch
|
2 |
+
from transformers.generation.utils import (
|
3 |
+
GenerationMixin,
|
4 |
+
validate_stopping_criteria,
|
5 |
+
StoppingCriteriaList,
|
6 |
+
)
|
7 |
+
from transformers import TextStreamer
|
8 |
+
|
9 |
def custom_generate(
|
10 |
self,
|
11 |
input_ids,
|