Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,39 +19,30 @@ FIM_SUFFIX = "<fim_suffix>"
|
|
19 |
FIM_INDICATOR = "<FILL_HERE>"
|
20 |
|
21 |
FORMATS = """## Model Formats
|
22 |
-
|
23 |
The model is pretrained on code and is formatted with special tokens in addition to the pure code data,\
|
24 |
such as prefixes specifying the source of the file or tokens separating code from a commit message.\
|
25 |
Use these templates to explore the model's capacities:
|
26 |
-
|
27 |
### 1. Prefixes 🏷️
|
28 |
For pure code files, use any combination of the following prefixes:
|
29 |
-
|
30 |
```
|
31 |
<reponame>REPONAME<filename>FILENAME<gh_stars>STARS\ncode<|endoftext|>
|
32 |
```
|
33 |
STARS can be one of: 0, 1-10, 10-100, 100-1000, 1000+
|
34 |
-
|
35 |
### 2. Commits 💾
|
36 |
The commits data is formatted as follows:
|
37 |
-
|
38 |
```
|
39 |
<commit_before>code<commit_msg>text<commit_after>code<|endoftext|>
|
40 |
```
|
41 |
-
|
42 |
### 3. Jupyter Notebooks 📓
|
43 |
The model is trained on Jupyter notebooks as Python scripts and structured formats like:
|
44 |
-
|
45 |
```
|
46 |
<start_jupyter><jupyter_text>text<jupyter_code>code<jupyter_output>output<jupyter_text>
|
47 |
```
|
48 |
-
|
49 |
### 4. Issues 🐛
|
50 |
We also trained on GitHub issues using the following formatting:
|
51 |
```
|
52 |
<issue_start><issue_comment>text<issue_comment>...<issue_closed>
|
53 |
```
|
54 |
-
|
55 |
### 5. Fill-in-the-middle 🧩
|
56 |
Fill in the middle requires rearranging the model inputs. The playground handles this for you - all you need is to specify where to fill:
|
57 |
```
|
@@ -84,31 +75,40 @@ clients = {
|
|
84 |
{"Wiki": tool_fn},
|
85 |
"""\
|
86 |
Answer the following question:
|
87 |
-
|
88 |
Q: In which branch of the arts is Patricia Neary famous?
|
89 |
A: Ballets
|
90 |
A2: <request><Wiki>Patricia Neary<call>Patricia Neary (born October 27, 1942) is an American ballerina, choreographer and ballet director, who has been particularly active in Switzerland. She has also been a highly successful ambassador for the Balanchine Trust, bringing George Balanchine's ballets to 60 cities around the globe.<response>
|
91 |
Result=Ballets<submit>
|
92 |
-
|
93 |
Q: Who won Super Bowl XX?
|
94 |
A: Chicago Bears
|
95 |
A2: <request><Wiki>Super Bowl XX<call>Super Bowl XX was an American football game between the National Football Conference (NFC) champion Chicago Bears and the American Football Conference (AFC) champion New England Patriots to decide the National Football League (NFL) champion for the 1985 season. The Bears defeated the Patriots by the score of 46–10, capturing their first NFL championship (and Chicago's first overall sports victory) since 1963, three years prior to the birth of the Super Bowl. Super Bowl XX was played on January 26, 1986 at the Louisiana Superdome in New Orleans.<response>
|
96 |
Result=Chicago Bears<submit>
|
97 |
"""
|
98 |
],
|
99 |
-
"StarCoderBase
|
100 |
Client(
|
101 |
-
"https://api-inference.huggingface.co/models/
|
102 |
headers={"Authorization": f"Bearer {HF_TOKEN}"},
|
103 |
),
|
104 |
-
{"Wiki":
|
105 |
"""\
|
106 |
-
|
107 |
-
|
108 |
-
Q:
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
"""
|
113 |
],
|
114 |
}
|
@@ -393,15 +393,12 @@ demo.queue(concurrency_count=16).launch(debug=True)
|
|
393 |
|
394 |
"""
|
395 |
Answer the following question:
|
396 |
-
|
397 |
Q: In which branch of the arts is Patricia Neary famous?
|
398 |
A: Ballets
|
399 |
A2: <request><Wiki>Patricia Neary<call>Patricia Neary (born October 27, 1942) is an American ballerina, choreographer and ballet director, who has been particularly active in Switzerland. She has also been a highly successful ambassador for the Balanchine Trust, bringing George Balanchine's ballets to 60 cities around the globe.<response>
|
400 |
Result=Ballets<submit>
|
401 |
-
|
402 |
Q: Who won Super Bowl XX?
|
403 |
A: Chicago Bears
|
404 |
A2: <request><Wiki>Super Bowl XX<call>Super Bowl XX was an American football game between the National Football Conference (NFC) champion Chicago Bears and the American Football Conference (AFC) champion New England Patriots to decide the National Football League (NFL) champion for the 1985 season. The Bears defeated the Patriots by the score of 46–10, capturing their first NFL championship (and Chicago's first overall sports victory) since 1963, three years prior to the birth of the Super Bowl. Super Bowl XX was played on January 26, 1986 at the Louisiana Superdome in New Orleans.<response>
|
405 |
Result=Chicago Bears<submit>
|
406 |
-
|
407 |
Q: In what state is Philadelphia located?"""
|
|
|
19 |
FIM_INDICATOR = "<FILL_HERE>"
|
20 |
|
21 |
FORMATS = """## Model Formats
|
|
|
22 |
The model is pretrained on code and is formatted with special tokens in addition to the pure code data,\
|
23 |
such as prefixes specifying the source of the file or tokens separating code from a commit message.\
|
24 |
Use these templates to explore the model's capacities:
|
|
|
25 |
### 1. Prefixes 🏷️
|
26 |
For pure code files, use any combination of the following prefixes:
|
|
|
27 |
```
|
28 |
<reponame>REPONAME<filename>FILENAME<gh_stars>STARS\ncode<|endoftext|>
|
29 |
```
|
30 |
STARS can be one of: 0, 1-10, 10-100, 100-1000, 1000+
|
|
|
31 |
### 2. Commits 💾
|
32 |
The commits data is formatted as follows:
|
|
|
33 |
```
|
34 |
<commit_before>code<commit_msg>text<commit_after>code<|endoftext|>
|
35 |
```
|
|
|
36 |
### 3. Jupyter Notebooks 📓
|
37 |
The model is trained on Jupyter notebooks as Python scripts and structured formats like:
|
|
|
38 |
```
|
39 |
<start_jupyter><jupyter_text>text<jupyter_code>code<jupyter_output>output<jupyter_text>
|
40 |
```
|
|
|
41 |
### 4. Issues 🐛
|
42 |
We also trained on GitHub issues using the following formatting:
|
43 |
```
|
44 |
<issue_start><issue_comment>text<issue_comment>...<issue_closed>
|
45 |
```
|
|
|
46 |
### 5. Fill-in-the-middle 🧩
|
47 |
Fill in the middle requires rearranging the model inputs. The playground handles this for you - all you need is to specify where to fill:
|
48 |
```
|
|
|
75 |
{"Wiki": tool_fn},
|
76 |
"""\
|
77 |
Answer the following question:
|
|
|
78 |
Q: In which branch of the arts is Patricia Neary famous?
|
79 |
A: Ballets
|
80 |
A2: <request><Wiki>Patricia Neary<call>Patricia Neary (born October 27, 1942) is an American ballerina, choreographer and ballet director, who has been particularly active in Switzerland. She has also been a highly successful ambassador for the Balanchine Trust, bringing George Balanchine's ballets to 60 cities around the globe.<response>
|
81 |
Result=Ballets<submit>
|
|
|
82 |
Q: Who won Super Bowl XX?
|
83 |
A: Chicago Bears
|
84 |
A2: <request><Wiki>Super Bowl XX<call>Super Bowl XX was an American football game between the National Football Conference (NFC) champion Chicago Bears and the American Football Conference (AFC) champion New England Patriots to decide the National Football League (NFL) champion for the 1985 season. The Bears defeated the Patriots by the score of 46–10, capturing their first NFL championship (and Chicago's first overall sports victory) since 1963, three years prior to the birth of the Super Bowl. Super Bowl XX was played on January 26, 1986 at the Louisiana Superdome in New Orleans.<response>
|
85 |
Result=Chicago Bears<submit>
|
86 |
"""
|
87 |
],
|
88 |
+
"StarCoderBase GSM8K": [
|
89 |
Client(
|
90 |
+
"https://api-inference.huggingface.co/models/lvwerra/starcoderbase-gsm8k",
|
91 |
headers={"Authorization": f"Bearer {HF_TOKEN}"},
|
92 |
),
|
93 |
+
{"Wiki": load_tool("lvwerra/python-interpreter")},
|
94 |
"""\
|
95 |
+
Example of using a Python API to solve math questions.
|
96 |
+
|
97 |
+
Q: Olivia has $23. She bought five bagels for $3 each. How much money does she have left?
|
98 |
+
|
99 |
+
<request><PythonInterpreter>
|
100 |
+
def solution():
|
101 |
+
money_initial = 23
|
102 |
+
bagels = 5
|
103 |
+
bagel_cost = 3
|
104 |
+
money_spent = bagels * bagel_cost
|
105 |
+
money_left = money_initial - money_spent
|
106 |
+
result = money_left
|
107 |
+
return result
|
108 |
+
print(solution())
|
109 |
+
<call>72<response>
|
110 |
+
|
111 |
+
Result = 72 <submit>
|
112 |
"""
|
113 |
],
|
114 |
}
|
|
|
393 |
|
394 |
"""
|
395 |
Answer the following question:
|
|
|
396 |
Q: In which branch of the arts is Patricia Neary famous?
|
397 |
A: Ballets
|
398 |
A2: <request><Wiki>Patricia Neary<call>Patricia Neary (born October 27, 1942) is an American ballerina, choreographer and ballet director, who has been particularly active in Switzerland. She has also been a highly successful ambassador for the Balanchine Trust, bringing George Balanchine's ballets to 60 cities around the globe.<response>
|
399 |
Result=Ballets<submit>
|
|
|
400 |
Q: Who won Super Bowl XX?
|
401 |
A: Chicago Bears
|
402 |
A2: <request><Wiki>Super Bowl XX<call>Super Bowl XX was an American football game between the National Football Conference (NFC) champion Chicago Bears and the American Football Conference (AFC) champion New England Patriots to decide the National Football League (NFL) champion for the 1985 season. The Bears defeated the Patriots by the score of 46–10, capturing their first NFL championship (and Chicago's first overall sports victory) since 1963, three years prior to the birth of the Super Bowl. Super Bowl XX was played on January 26, 1986 at the Louisiana Superdome in New Orleans.<response>
|
403 |
Result=Chicago Bears<submit>
|
|
|
404 |
Q: In what state is Philadelphia located?"""
|