pszemraj commited on
Commit
c68da8b
1 Parent(s): 81e168f
Files changed (1) hide show
  1. README.md +130 -119
README.md CHANGED
@@ -8,135 +8,146 @@ tags:
8
  - instruct
9
  - instructions
10
  - code
 
11
  metrics:
12
  - rouge
13
  language:
14
  - en
15
  widget:
16
- - text: |
17
- git lfs install
18
- huggingface-cli lfs-enable-largefiles .
19
- git lfs track "*.bin"
20
- git add .
21
- git commit -a -m "add fp32 chkpt"
22
- git push
23
- example_title: bash
24
-
25
- - text: |
26
- export interface DocumentParams {
27
- pageContent: string;
28
-
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
- metadata: Record<string, any>;
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
 
 
 
 
 
 
32
 
33
- /**
34
- * Interface for interacting with a document.
35
- */
36
- export class Document implements DocumentParams {
37
- pageContent: string;
38
 
39
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
- metadata: Record<string, any>;
41
 
42
- constructor(fields?: Partial<DocumentParams>) {
43
- this.pageContent = fields?.pageContent ?? this.pageContent;
44
- this.metadata = fields?.metadata ?? {};
45
- }
46
- }
47
- example_title: js
48
- - text: |
49
- def merge(left, right):
50
- if len(left) == 0:
51
- return right
52
-
53
- if len(right) == 0:
54
- return left
55
-
56
- result = []
57
- index_left = index_right = 0
58
-
59
- while len(result) < len(left) + len(right):
60
- if left[index_left] <= right[index_right]:
61
- result.append(left[index_left])
62
- index_left += 1
63
- else:
64
- result.append(right[index_right])
65
- index_right += 1
66
-
67
- if index_right == len(right):
68
- result += left[index_left:]
69
- break
70
-
71
- if index_left == len(left):
72
- result += right[index_right:]
73
- break
74
-
75
- return result
76
- example_title: merge
77
-
78
- - text: |
79
- import pandas as pd
80
- import plotly.graph_objects as go
81
-
82
- df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')
83
-
84
- fig = go.Figure(go.Scatter(x = df['AAPL_x'], y = df['AAPL_y'],
85
- name='Share Prices (in USD)'))
86
-
87
- fig.update_layout(title='Apple Share Prices over time (2014)',
88
- plot_bgcolor='rgb(230, 230,230)',
89
- showlegend=True)
90
-
91
- fig.show()
92
- example_title: plot
93
- - text: |
94
- from spellchecker import SpellChecker
95
-
96
- spell = SpellChecker()
97
-
98
- def check_word_spelling(word: str):
99
- misspelled = spell.unknown([word])
100
- return len(misspelled) == 0
101
-
102
- def eval_and_replace(text: str, match_token: str = "- "):
103
- if match_token not in text:
104
- return text
105
- else:
106
- while True:
107
- full_before_text = text.split(match_token, maxsplit=1)[0]
108
- before_text = [
109
- char for char in full_before_text.split()[-1] if char.isalpha()
110
- ]
111
- before_text = "".join(before_text)
112
- full_after_text = text.split(match_token, maxsplit=1)[-1]
113
- after_text = [char for char in full_after_text.split()[0] if char.isalpha()]
114
- after_text = "".join(after_text)
115
- full_text = before_text + after_text
116
- if check_word_spelling(full_text):
117
- text = full_before_text + full_after_text
118
- else:
119
- text = full_before_text + " " + full_after_text
120
- if match_token not in text:
121
- break
122
- return text
123
-
124
- text = "I- am- a go- od- boy"
125
- eval_and_replace(text)
126
- example_title: spell check
127
- - text: |
128
- import torch
129
- from transformers import AutoTokenizer, AutoModelForSequenceClassification
130
-
131
- checkpoint = "distilbert-base-uncased-finetuned-sst-2-english"
132
- tokenizer = AutoTokenizer.from_pretrained(checkpoint)
133
- model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
134
- sequences = ["I've been waiting for a HuggingFace course my whole life.", "So have I!"]
135
-
136
- tokens = tokenizer(sequences, padding=True, truncation=True, return_tensors="pt")
137
- output = model(**tokens)
138
- example_title: model inference
139
 
 
 
140
  inference:
141
  parameters:
142
  max_length: 96
 
8
  - instruct
9
  - instructions
10
  - code
11
+ - instructiongen
12
  metrics:
13
  - rouge
14
  language:
15
  - en
16
  widget:
17
+ - text: |
18
+ git lfs install
19
+ huggingface-cli lfs-enable-largefiles .
20
+ git lfs track "*.bin"
21
+ git add .
22
+ git commit -a -m "add fp32 chkpt"
23
+ git push
24
+ example_title: bash
25
+ - text: |
26
+ export interface DocumentParams {
27
+ pageContent: string;
28
+
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ metadata: Record<string, any>;
31
+ }
32
+
33
+ /**
34
+ * Interface for interacting with a document.
35
+ */
36
+ export class Document implements DocumentParams {
37
+ pageContent: string;
38
+
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ metadata: Record<string, any>;
41
+
42
+ constructor(fields?: Partial<DocumentParams>) {
43
+ this.pageContent = fields?.pageContent ?? this.pageContent;
44
+ this.metadata = fields?.metadata ?? {};
45
  }
46
+ }
47
+ example_title: js
48
+ - text: |
49
+ def merge(left, right):
50
+ if len(left) == 0:
51
+ return right
52
 
53
+ if len(right) == 0:
54
+ return left
 
 
 
55
 
56
+ result = []
57
+ index_left = index_right = 0
58
 
59
+ while len(result) < len(left) + len(right):
60
+ if left[index_left] <= right[index_right]:
61
+ result.append(left[index_left])
62
+ index_left += 1
63
+ else:
64
+ result.append(right[index_right])
65
+ index_right += 1
66
+
67
+ if index_right == len(right):
68
+ result += left[index_left:]
69
+ break
70
+
71
+ if index_left == len(left):
72
+ result += right[index_right:]
73
+ break
74
+
75
+ return result
76
+ example_title: merge
77
+ - text: >
78
+ import pandas as pd
79
+
80
+ import plotly.graph_objects as go
81
+
82
+
83
+ df =
84
+ pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')
85
+
86
+
87
+ fig = go.Figure(go.Scatter(x = df['AAPL_x'], y = df['AAPL_y'],
88
+ name='Share Prices (in USD)'))
89
+
90
+ fig.update_layout(title='Apple Share Prices over time (2014)',
91
+ plot_bgcolor='rgb(230, 230,230)',
92
+ showlegend=True)
93
+
94
+ fig.show()
95
+ example_title: plot
96
+ - text: |
97
+ from spellchecker import SpellChecker
98
+
99
+ spell = SpellChecker()
100
+
101
+ def check_word_spelling(word: str):
102
+ misspelled = spell.unknown([word])
103
+ return len(misspelled) == 0
104
+
105
+ def eval_and_replace(text: str, match_token: str = "- "):
106
+ if match_token not in text:
107
+ return text
108
+ else:
109
+ while True:
110
+ full_before_text = text.split(match_token, maxsplit=1)[0]
111
+ before_text = [
112
+ char for char in full_before_text.split()[-1] if char.isalpha()
113
+ ]
114
+ before_text = "".join(before_text)
115
+ full_after_text = text.split(match_token, maxsplit=1)[-1]
116
+ after_text = [char for char in full_after_text.split()[0] if char.isalpha()]
117
+ after_text = "".join(after_text)
118
+ full_text = before_text + after_text
119
+ if check_word_spelling(full_text):
120
+ text = full_before_text + full_after_text
121
+ else:
122
+ text = full_before_text + " " + full_after_text
123
+ if match_token not in text:
124
+ break
125
+ return text
126
+
127
+ text = "I- am- a go- od- boy"
128
+ eval_and_replace(text)
129
+ example_title: spell check
130
+ - text: >
131
+ import torch
132
+
133
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
134
+
135
+
136
+ checkpoint = "distilbert-base-uncased-finetuned-sst-2-english"
137
+
138
+ tokenizer = AutoTokenizer.from_pretrained(checkpoint)
139
+
140
+ model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
141
+
142
+ sequences = ["I've been waiting for a HuggingFace course my whole life.",
143
+ "So have I!"]
144
+
145
+
146
+ tokens = tokenizer(sequences, padding=True, truncation=True,
147
+ return_tensors="pt")
 
 
 
 
 
 
 
 
148
 
149
+ output = model(**tokens)
150
+ example_title: model inference
151
  inference:
152
  parameters:
153
  max_length: 96