Views
No views yet
pad_token_id: 0bos_token_id: 1eos_token_id: 2config.json):generation_config.json):1import requests
2
3api_url = "https://api-inference.huggingface.co/models/rahul77/llama-2-7b-chat-finetune"
4headers = {
5 "Authorization": "Bearer YOUR_API_TOKEN", # Replace with your Hugging Face API token
6 "Content-Type": "application/json"
7}
8
9data = {
10 "inputs": "What is a large language model?",
11 "parameters": {
12 "max_length": 50
13 }
14}
15
16response = requests.post(api_url, headers=headers, json=data)
17
18if response.status_code == 200:
19 print(response.json())
20else:
21 print(f"Error: {response.status_code}")
22 print(response.json())
23
24
25---
26license: apache-2.0
27---