Librarian Bot: Add base_model information to model
#2
by
librarian-bot
- opened
README.md
CHANGED
|
@@ -1,134 +1,74 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
license:
|
| 3 |
- apache-2.0
|
| 4 |
- cc-by-nc-4.0
|
| 5 |
-
datasets: pszemraj/fleece2instructions-codealpaca
|
| 6 |
tags:
|
| 7 |
- generated_from_trainer
|
| 8 |
- instruct
|
| 9 |
- instructions
|
| 10 |
- code
|
| 11 |
- instructiongen
|
|
|
|
| 12 |
metrics:
|
| 13 |
- rouge
|
| 14 |
-
language:
|
| 15 |
-
- en
|
| 16 |
widget:
|
| 17 |
-
- text:
|
| 18 |
-
|
| 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 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 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 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
if len(right)
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 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 |
-
|
| 79 |
-
|
| 80 |
-
|
| 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 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 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 |
|
|
@@ -139,19 +79,21 @@ widget:
|
|
| 139 |
|
| 140 |
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
|
| 141 |
|
| 142 |
-
sequences = ["I've been waiting for a HuggingFace course my whole life.",
|
| 143 |
-
|
| 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
|
| 154 |
num_beams: 4
|
|
|
|
| 155 |
---
|
| 156 |
|
| 157 |
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
license:
|
| 5 |
- apache-2.0
|
| 6 |
- cc-by-nc-4.0
|
|
|
|
| 7 |
tags:
|
| 8 |
- generated_from_trainer
|
| 9 |
- instruct
|
| 10 |
- instructions
|
| 11 |
- code
|
| 12 |
- instructiongen
|
| 13 |
+
datasets: pszemraj/fleece2instructions-codealpaca
|
| 14 |
metrics:
|
| 15 |
- rouge
|
|
|
|
|
|
|
| 16 |
widget:
|
| 17 |
+
- text: 'git lfs install
|
| 18 |
+
|
| 19 |
huggingface-cli lfs-enable-largefiles .
|
| 20 |
+
|
| 21 |
git lfs track "*.bin"
|
| 22 |
+
|
| 23 |
git add .
|
| 24 |
+
|
| 25 |
git commit -a -m "add fp32 chkpt"
|
| 26 |
+
|
| 27 |
git push
|
| 28 |
+
|
| 29 |
+
'
|
| 30 |
example_title: bash
|
| 31 |
+
- text: "export interface DocumentParams {\n pageContent: string;\n\n // eslint-disable-next-line\
|
| 32 |
+
\ @typescript-eslint/no-explicit-any\n metadata: Record<string, any>;\n}\n\n\
|
| 33 |
+
/**\n * Interface for interacting with a document.\n */\nexport class Document\
|
| 34 |
+
\ implements DocumentParams {\n pageContent: string;\n\n // eslint-disable-next-line\
|
| 35 |
+
\ @typescript-eslint/no-explicit-any\n metadata: Record<string, any>;\n\n constructor(fields?:\
|
| 36 |
+
\ Partial<DocumentParams>) {\n this.pageContent = fields?.pageContent ?? this.pageContent;\n\
|
| 37 |
+
\ this.metadata = fields?.metadata ?? {};\n }\n}\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
example_title: js
|
| 39 |
+
- text: "def merge(left, right):\n if len(left) == 0:\n return right\n\n\
|
| 40 |
+
\ if len(right) == 0:\n return left\n\n result = []\n index_left\
|
| 41 |
+
\ = index_right = 0\n\n while len(result) < len(left) + len(right):\n \
|
| 42 |
+
\ if left[index_left] <= right[index_right]:\n result.append(left[index_left])\n\
|
| 43 |
+
\ index_left += 1\n else:\n result.append(right[index_right])\n\
|
| 44 |
+
\ index_right += 1\n\n if index_right == len(right):\n \
|
| 45 |
+
\ result += left[index_left:]\n break\n\n if index_left\
|
| 46 |
+
\ == len(left):\n result += right[index_right:]\n break\n\
|
| 47 |
+
\n return result\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
example_title: merge
|
| 49 |
+
- text: "import pandas as pd\nimport plotly.graph_objects as go\n\ndf = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_apple_stock.csv')\n\
|
| 50 |
+
\nfig = go.Figure(go.Scatter(x = df['AAPL_x'], y = df['AAPL_y'],\n \
|
| 51 |
+
\ name='Share Prices (in USD)'))\n\nfig.update_layout(title='Apple Share\
|
| 52 |
+
\ Prices over time (2014)',\n plot_bgcolor='rgb(230, 230,230)',\n\
|
| 53 |
+
\ showlegend=True)\n\nfig.show()\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
example_title: plot
|
| 55 |
+
- text: "from spellchecker import SpellChecker\n\nspell = SpellChecker()\n\ndef check_word_spelling(word:\
|
| 56 |
+
\ str):\n misspelled = spell.unknown([word])\n return len(misspelled) ==\
|
| 57 |
+
\ 0\n\ndef eval_and_replace(text: str, match_token: str = \"- \"):\n if match_token\
|
| 58 |
+
\ not in text:\n return text\n else:\n while True:\n \
|
| 59 |
+
\ full_before_text = text.split(match_token, maxsplit=1)[0]\n before_text\
|
| 60 |
+
\ = [\n char for char in full_before_text.split()[-1] if char.isalpha()\n\
|
| 61 |
+
\ ]\n before_text = \"\".join(before_text)\n \
|
| 62 |
+
\ full_after_text = text.split(match_token, maxsplit=1)[-1]\n after_text\
|
| 63 |
+
\ = [char for char in full_after_text.split()[0] if char.isalpha()]\n \
|
| 64 |
+
\ after_text = \"\".join(after_text)\n full_text = before_text +\
|
| 65 |
+
\ after_text\n if check_word_spelling(full_text):\n \
|
| 66 |
+
\ text = full_before_text + full_after_text\n else:\n \
|
| 67 |
+
\ text = full_before_text + \" \" + full_after_text\n if match_token\
|
| 68 |
+
\ not in text:\n break\n return text\n\ntext = \"I- am-\
|
| 69 |
+
\ a go- od- boy\"\neval_and_replace(text)\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
example_title: spell check
|
| 71 |
+
- text: 'import torch
|
|
|
|
| 72 |
|
| 73 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 74 |
|
|
|
|
| 79 |
|
| 80 |
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
|
| 81 |
|
| 82 |
+
sequences = ["I''ve been waiting for a HuggingFace course my whole life.", "So
|
| 83 |
+
have I!"]
|
| 84 |
|
| 85 |
|
| 86 |
+
tokens = tokenizer(sequences, padding=True, truncation=True, return_tensors="pt")
|
|
|
|
| 87 |
|
| 88 |
output = model(**tokens)
|
| 89 |
+
|
| 90 |
+
'
|
| 91 |
example_title: model inference
|
| 92 |
inference:
|
| 93 |
parameters:
|
| 94 |
max_length: 96
|
| 95 |
num_beams: 4
|
| 96 |
+
base_model: facebook/bart-large
|
| 97 |
---
|
| 98 |
|
| 99 |
|