Spaces:
Running
Running
Update tokenizer.py
Browse files- tokenizer.py +46 -44
tokenizer.py
CHANGED
@@ -4,48 +4,50 @@ 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 |
-
model_type = {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
51 |
return code
|
|
|
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 |
+
model_type = {
|
8 |
+
"model_type": "compositional",
|
9 |
+
"task": "Develop an app that allows users to search for and modify files on a remote server using the SSH protocol",
|
10 |
+
"history": "",
|
11 |
+
"history_additions": [
|
12 |
+
"Set the task description to 'Develop an app that allows users to search for and modify files on a remote server using the SSH protocol'",
|
13 |
+
"Updated the task description to 'Connect to the remote server using the SSH protocol'",
|
14 |
+
"Completed the task: Connect to the remote server using the SSH protocol",
|
15 |
+
"Updated the task description to 'Search for a file on the remote server'",
|
16 |
+
"Completed the task: Search for a file on the remote server",
|
17 |
+
"Updated the task description to 'Modify the file found on the remote server'",
|
18 |
+
"Completed the task: Modify the file found on the remote server",
|
19 |
+
"Updated the task description to 'Verify the file modifications using the updated file'",
|
20 |
+
"Completed the task: Verify the file modifications using the updated file",
|
21 |
+
"Updated the task description to 'Create a summary of the timeline of progress and any important challenges faced during the development of the app'",
|
22 |
+
"Completed the task: Create a summary of the timeline of progress and any important challenges faced during the development of the app",
|
23 |
+
"Updated the task description to 'Deploy the app to the production server'",
|
24 |
+
"Completed the task: Deploy the app to the production server",
|
25 |
+
"Updated the task description to 'Monitor the performance of the deployed app and make adjustments as necessary'",
|
26 |
+
"Completed the task: Monitor the performance of the deployed app and make adjustments as necessary",
|
27 |
+
"Updated the task description to 'Maintain and update the app in response to user feedback and any discovered bugs'"
|
28 |
+
],
|
29 |
+
"history_removals": [],
|
30 |
+
"model_log": [
|
31 |
+
"Model prompt: You are attempting to complete the task task: Develop an app that allows users to search for and modify files on a remote server using the SSH protocol Progress: Connect to the remote server using the SSH protocol",
|
32 |
+
"Model response: Connect to the remote server using the SSH protocol",
|
33 |
+
"Model prompt: Updated the task description to 'Search for a file on the remote server'",
|
34 |
+
"Model response: Search for a file on the remote server",
|
35 |
+
"Model prompt: Completed the task: Search for a file on the remote server Progress: Connect to the remote server using the SSH protocol\nSearch for a file on the remote server",
|
36 |
+
"Model response: You have successfully completed the task: Search for a file on the remote server",
|
37 |
+
"Model prompt: Updated the task description to 'Modify the file found on the remote server'",
|
38 |
+
"Model response: Modify the file found on the remote server",
|
39 |
+
"Model prompt: Completed the task: Modify the file found on the remote server Progress: Connect to the remote server using the SSH protocol\nSearch for a file on the remote server\nModify the file found on the remote server",
|
40 |
+
"Model response: You have successfully completed the task: Modify the file found on the remote server",
|
41 |
+
"Model prompt: Updated the task description to 'Verify the file modifications using the updated file'",
|
42 |
+
"Model response: Verify the file modifications using the updated file",
|
43 |
+
"Model prompt: Completed the task: Verify the file modifications using the updated file Progress: Connect to the remote server using the SSH protocol\nSearch for a file on the remote server\nModify the file found on the remote server\nVerify the file modifications using the updated file",
|
44 |
+
"Model response: You have successfully completed the task: Verify the file modifications using the updated file",
|
45 |
+
"Model prompt: Updated the task description to 'Create a summary of the timeline of progress and any important challenges faced during the development of the app'",
|
46 |
+
"Model response: Create a summary of the timeline of progress and any important challenges faced during the development of the app",
|
47 |
+
"Model prompt: Completed the task: Create a summary of the timeline of progress and any important challenges faced.",
|
48 |
+
"Model response: All tasks complete. What shall I do next?"
|
49 |
+
]
|
50 |
+
}
|
51 |
+
|
52 |
+
code = generator(input_text, max_length=50, num_return_sequences=1, do_sample=True)[0]['generated_text']
|
53 |
return code
|