Spaces:
Runtime error
Runtime error
ashioyajotham
commited on
Commit
•
cabdd14
1
Parent(s):
9e26245
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
fine_tuned_model = "ashioyajotham/results"
|
2 |
|
3 |
def generate_code(input_text):
|
|
|
4 |
# Use your fine-tuned model to generate code here
|
5 |
-
generated_code = fine_tuned_model.generate(input_text)
|
6 |
-
|
|
|
|
|
7 |
|
8 |
import gradio as gr
|
9 |
|
|
|
1 |
fine_tuned_model = "ashioyajotham/results"
|
2 |
|
3 |
def generate_code(input_text):
|
4 |
+
inputs = tokenizer.encode(input_text, return_tensors='pt')
|
5 |
# Use your fine-tuned model to generate code here
|
6 |
+
generated_code = fine_tuned_model.generate(input_text, max_length=100, temperature = .7, do_sample=True, pad_token_id=tokenizer.eos_token_id)
|
7 |
+
completion = tokenizer.decode(generated_code[0])
|
8 |
+
|
9 |
+
return completion
|
10 |
|
11 |
import gradio as gr
|
12 |
|