Spaces:
Running
Running
acecalisto3
commited on
Commit
•
6f2142c
1
Parent(s):
d617eb9
Update tokenizer.py
Browse files- tokenizer.py +7 -4
tokenizer.py
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
-
import
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
|
3 |
+
def generate_code_from_model(input_text):
|
4 |
+
"""Generates code using the bigscience/T0_3B model."""
|
5 |
+
model_name = 'bigscience/T0_3B' # Choose your model
|
6 |
+
generator = pipeline('text-generation', model=model_name)
|
7 |
+
code = generator(input_text, max_length=50, num_return_sequences=1, do_sample=True)[0]['generated_text']
|
8 |
+
return code
|