Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,6 +14,20 @@ On this organization, you can find the following:
|
|
| 14 |
- Llama2 7B Chat - [Interactive UI](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat)
|
| 15 |
- Llama2 13B Chat - [Interactive UI](https://huggingface.co/spaces/huggingface-projects/llama-2-13b-chat)
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
**Llama2 Inference API**
|
| 18 |
|
| 19 |
import requests
|
|
|
|
| 14 |
- Llama2 7B Chat - [Interactive UI](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat)
|
| 15 |
- Llama2 13B Chat - [Interactive UI](https://huggingface.co/spaces/huggingface-projects/llama-2-13b-chat)
|
| 16 |
|
| 17 |
+
**Llama3 Inference API**
|
| 18 |
+
|
| 19 |
+
import requests
|
| 20 |
+
|
| 21 |
+
API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3-8B"
|
| 22 |
+
headers = {"Authorization": "Bearer hf_xxxxxxx"}
|
| 23 |
+
|
| 24 |
+
def query(payload):
|
| 25 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 26 |
+
return response.json()
|
| 27 |
+
|
| 28 |
+
output = query({"inputs": "What is the capital of France?",})
|
| 29 |
+
print (output[0]['generated_text'])
|
| 30 |
+
|
| 31 |
**Llama2 Inference API**
|
| 32 |
|
| 33 |
import requests
|