acecalisto3 commited on
Commit
92ac945
·
verified ·
1 Parent(s): 7763bca

Update tokenizer.py

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