RonanMcGovern commited on
Commit
be631f4
1 Parent(s): 50dfeeb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +85 -10
README.md CHANGED
@@ -1,14 +1,4 @@
1
  ---
2
- extra_gated_heading: Access Llama 2 on Hugging Face
3
- extra_gated_description: >-
4
- This is a form to enable access to Llama 2 on Hugging Face after you have been
5
- granted access from Meta. Please visit the [Meta website](https://ai.meta.com/resources/models-and-libraries/llama-downloads) and accept our
6
- license terms and acceptable use policy before submitting this form. Requests
7
- will be processed in 1-2 days.
8
- extra_gated_prompt: "**Your Hugging Face account email address MUST match the email you provide on the Meta website, or your request will not be approved.**"
9
- extra_gated_button_content: Submit
10
- extra_gated_fields:
11
- I agree to share my name, email address and username with Meta and confirm that I have already been granted download access on the Meta website: checkbox
12
  language:
13
  - en
14
  pipeline_tag: text-generation
@@ -21,6 +11,91 @@ tags:
21
  - llama
22
  - llama-2
23
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  # **Llama 2**
25
  Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 7B fine-tuned model, optimized for dialogue use cases and converted for the Hugging Face Transformers format. Links to other models can be found in the index at the bottom.
26
 
 
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  language:
3
  - en
4
  pipeline_tag: text-generation
 
11
  - llama
12
  - llama-2
13
  ---
14
+ # Function Calling Fine-tuned Llama 2 Chat
15
+
16
+ The model is suitable for commercial use and is licensed with the Llama 2 Community license.
17
+
18
+ Check out other fine-tuned function calling models [here](https://trelis.com/function-calling/).
19
+
20
+ ## Inference Scripts
21
+ Out-of-the-box inference scripts are available for purchase [here](https://trelis.com/enterprise-server-api-and-inference-guide/).
22
+
23
+ ## Prompt Format
24
+ ```
25
+ B_FUNC, E_FUNC = "You have access to the following functions. Use them if required:\n\n", "\n\n"
26
+ B_INST, E_INST = "[INST] ", " [/INST]" #Llama style
27
+ prompt = f"{E_INST}{B_FUNC}{functionList.strip()}{E_FUNC}{B_INST}{user_prompt.strip()}{E_INST}\n\n"
28
+ ```
29
+
30
+ ## Sample Prompt and Response:
31
+ ```
32
+ [INST] You have access to the following functions. Use them if required:
33
+
34
+ [
35
+ {
36
+ "type": "function",
37
+ "function": {
38
+ "name": "get_big_stocks",
39
+ "description": "Get the names of the largest N stocks by market cap",
40
+ "parameters": {
41
+ "type": "object",
42
+ "properties": {
43
+ "number": {
44
+ "type": "integer",
45
+ "description": "The number of largest stocks to get the names of, e.g. 25"
46
+ },
47
+ "region": {
48
+ "type": "string",
49
+ "description": "The region to consider, can be \"US\" or \"World\"."
50
+ }
51
+ },
52
+ "required": [
53
+ "number"
54
+ ]
55
+ }
56
+ }
57
+ },
58
+ {
59
+ "type": "function",
60
+ "function": {
61
+ "name": "get_stock_price",
62
+ "description": "Get the stock price of an array of stocks",
63
+ "parameters": {
64
+ "type": "object",
65
+ "properties": {
66
+ "names": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "string"
70
+ },
71
+ "description": "An array of stocks"
72
+ }
73
+ },
74
+ "required": [
75
+ "names"
76
+ ]
77
+ }
78
+ }
79
+ }
80
+ ]
81
+
82
+ [INST] Get the names of the five largest stocks in the US by market cap [/INST]
83
+
84
+ {
85
+ "name": "get_big_stocks",
86
+ "arguments": {
87
+ "number": 5,
88
+ "region": "US"
89
+ }
90
+ }</s>
91
+ ```
92
+
93
+ # Dataset
94
+ See [Trelis/function_calling_v3](https://huggingface.co/datasets/Trelis/function_calling_v3).
95
+
96
+ ~~~
97
+ The original repo card follows below.
98
+ ~~~
99
  # **Llama 2**
100
  Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 7B fine-tuned model, optimized for dialogue use cases and converted for the Hugging Face Transformers format. Links to other models can be found in the index at the bottom.
101