SwastikM commited on
Commit
731b15d
1 Parent(s): ea312db

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -4
README.md CHANGED
@@ -77,11 +77,19 @@ print(code)
77
  ```
78
 
79
  ### A Test Example
80
- ``````
81
- User Prompt: Write a Python program to implement K-Means clustering. The program should take two mandatory arguments, k and data, where k is the number of clusters and data is a 2D array containing the data points k = 3
82
- data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]
83
 
84
- Generated Output: Write a Python program to implement K-Means clustering. The program should take two mandatory arguments, k and data, where k is the number of clusters and data is a 2D array containing the data points k = 3
 
 
 
 
 
 
 
 
85
  data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] Ready for action! Let's do this! ```python
86
  import numpy as np
87
 
 
77
  ```
78
 
79
  ### A Test Example
80
+ ```python
81
+ User_Prompt = """Write a Python program to implement K-Means clustering. The program should take two mandatory arguments, k and data, where k is the number of clusters and data is a 2D array containing the data points k = 3
82
+ data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]]"""
83
 
84
+ inputs = tokenizer(User_Prompt, return_tensors="pt").input_ids.to('cuda')
85
+ outputs = model.generate(inputs, max_new_tokens=500, do_sample=False, num_beams=1)
86
+ python_code = tokenizer.decode(outputs[0], skip_special_tokens=True)
87
+
88
+ print("Generated Output:",python_code)
89
+ >>>
90
+ ```
91
+ ``````
92
+ Write a Python program to implement K-Means clustering. The program should take two mandatory arguments, k and data, where k is the number of clusters and data is a 2D array containing the data points k = 3
93
  data = [[1, 2], [3, 4], [5, 6], [7, 8], [9, 10]] Ready for action! Let's do this! ```python
94
  import numpy as np
95