File size: 2,097 Bytes
59d9e23
 
 
 
 
8980628
59d9e23
 
 
 
8980628
 
 
503edad
 
8980628
bba65f4
503edad
 
 
 
8980628
 
ea14971
8980628
80f2d2d
 
 
8980628
09be525
7019773
9d52cad
 
09be525
9d52cad
8980628
 
59d9e23
 
 
8980628
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width" />
		<title>Hugging Face Sheets add-on</title>
		<link rel="stylesheet" href="style.css" />
	</head>
	<body>
		<div class="card">
			<h1>Hugging Face Sheets add-on</h1>
			<p>Hugging Face in your spreadsheet?</p>
			<p>Because spreadsheets can be incredibly useful for journalists, this project connects Hugging Face Inference API with Google Sheets. Handy for prompting, extraction, classification, translation, etc.</p>
			<img src="demo.gif" width="100%">		
			<h3>Steps</h3>
			<ol>
				<li><p>Create a script in Google Sheets (Extensions &gt; Apps Script).</p></li>
				<li><p>Replace the existing code with <a href="code.gs" target="_blank">this script</a> and save it.</p></li>
				<li><p>Back in the Sheet, you should see a new tab called "Hugging Sheets".</p></li>
				<li><p>Click on it and add your API key.</p></li>
				<li><p>Voilà!</p></li>
			</ol>
			<p><strong>Note:</strong> To generate your API key, click on the <a href="https://huggingface.co/settings/tokens">Access Token tab in your Hugging Face settings</a>.</p>
			<p>Tested with Llama 8B and 70B, and Mistral, e.g.:</p>
			<ul>
				<li><code>=HF(cell or direct input, "meta-llama/Meta-Llama-3-70B-Instruct", prompt)</code></li>
				<li><code>=HF(cell or direct input, "meta-llama/Meta-Llama-3-8B-Instruct", prompt)</code></li>
				<li><code>=HF(cell or direct input, "mistralai/Mistral-7B-Instruct-v0.3", prompt)</code></li>
			</ul>

            <p><strong>Update:</strong> Thanks to <a href="https://huggingface.co/louisbrulenaudet" target="_blank">@louisbrulenaudet</a>, you can now customize your prompt and select the model of your choice directly in the sheet.</p>
            <p>The formula is:</p> 
              <li><code>=HF(cell or direct input, cell with the name of the model, cell with the prompt)</code></li>
          
			<p>This <a href="https://huggingface.co/blog/inference-pro#supported-models">blog post</a> gives a good overview of the supported models.</p>


		</div>
	</body>
</html>