acecalisto3 commited on
Commit
6f2142c
1 Parent(s): d617eb9

Update tokenizer.py

Browse files
Files changed (1) hide show
  1. tokenizer.py +7 -4
tokenizer.py CHANGED
@@ -1,5 +1,8 @@
1
- import transformers
2
 
3
- class CodeTokenizer(transformers.AutoTokenizer):
4
- def __init__(self, PhiCo-D-Instruct):
5
- super().__init__.from_pretrained(model_name)
 
 
 
 
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