baconnier commited on
Commit
381c7c7
·
verified ·
1 Parent(s): 06d0582

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -84
README.md CHANGED
@@ -9,16 +9,14 @@ tags:
9
  - llama
10
  - trl
11
  - orpo
12
- base_model: cognitivecomputations/dolphin-2.9-llama3-8b
13
  ---
14
- # This content is strictly for educational purposes and should not be construed as financial advice. Please exercise caution when applying any information provided.
15
-
16
 
17
  # Uploaded model
18
 
19
  - **Developed by:** baconnier
20
  - **License:** apache-2.0
21
- - **Finetuned from model :** cognitivecomputations/dolphin-2.9-llama3-8b
22
 
23
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
24
 
@@ -29,13 +27,10 @@ This model was trained ORPO , using ChatML prompt template format.
29
 
30
  ```
31
  <|im_start|>user
32
- Act as an exotic structurator and do not hesitate to merge standard and exotic products.
33
- Currently, inflation is 5% and 1-year swaps are valued at 6%.
34
- I expect inflation to reach 15% by the end of the year.
35
- Can you create the 10 most complicated structured derivative products to handle this scenario?
36
- Rank them by profitability, give me a score for profitability and another for risk from 0 to 10.
37
- Add an explaination for each structured products in maximum of 3 sentences.
38
- Think step by step and give me a concise, bulleted answer.<|im_end|>
39
  <|im_start|>assistant
40
 
41
  ```
@@ -51,10 +46,10 @@ from openai import OpenAI
51
  client = OpenAI(base_url="http://localhost:8080/v1", api_key="TGI")
52
 
53
  completion = client.chat.completions.create(
54
- model="baconnier/finance_dolphin_orpo_llama3_8B_r64_51K_GGUF-unsloth.Q4_K_M",
55
  messages=[
56
- {"role": "system", "content": "Act as a senior banker answering in 3 sentences in bullet points format."},
57
- {"role": "user", "content": " What is CDS compare it to a swap "},
58
  {"role": "assistant", "content": ""}
59
  ],
60
  max_tokens=400,
@@ -64,14 +59,8 @@ print(completion.choices[0].message.content)
64
  ```
65
  Output:
66
  ```
67
- CDS:
68
- - Credit Default Swap (CDS) is a financial derivative contract between two parties (buyer and seller) for insurance against default or credit risk associated with a bond or loan
69
- - Protection buyer pays a premium to protection seller in exchange for the right to receive payment if a credit event occurs
70
- - Protection seller is usually a financial institution, while protection buyer can be an investor or a bank
71
- Swap:
72
- - Swap is an agreement between two parties to exchange cash flows, typically interest payments or principal at a future date
73
- - Common types of swaps include interest rate swaps, currency swaps, and commodity swaps
74
- CDS differs from swaps as it focuses on credit risk protection, while swaps involve cash flow exchange.
75
  ```
76
 
77
  # Example with Transformers and pipeline:
@@ -82,7 +71,7 @@ See the snippet below for usage with Transformers:
82
  import transformers
83
  import torch
84
 
85
- model_id = "baconnier/finance_dolphin_orpo_llama3_8B_r64_51K"
86
 
87
  pipeline = transformers.pipeline(
88
  "text-generation",
@@ -91,15 +80,16 @@ pipeline = transformers.pipeline(
91
  device="cuda",
92
  )
93
 
94
- messages = [
95
- {"role": "user", "content": '''Act as an exotic structurator and do not hesitate to merge standard and exotic products.
96
- Currently, inflation is 5% and 1-year swaps are valued at 6%.
97
- I expect inflation to reach 15% by the end of the year.
98
- Can you create the 10 most complicated structured derivative products to handle this scenario?
99
- Rank them by profitability, give me a score for profitability and another for risk from 0 to 10.
100
- Add an explaination for each structured products in maximum of 3 sentences.
101
- Think step by step and give me a concise, bulleted answer.'''},
102
- ]
 
103
 
104
  prompt = pipeline.tokenizer.apply_chat_template(
105
  messages,
@@ -126,57 +116,11 @@ print(outputs[0]["generated_text"][len(prompt):])
126
  Answer:
127
 
128
  ```
129
- To handle the scenario of inflation reaching 15% by the end of the year, I can create the following 10 most complicated structured derivative products, ranked by profitability and risk:
130
-
131
- 1. Inflation-linked swap spread strategy (Profitability: 9, Risk: 7)
132
- - Buy 1-year swaps and sell 15-year swaps to profit from the expected inflation increase.
133
- - Risk is moderate due to interest rate and inflation rate changes.
134
-
135
- 2. Inflation-linked bond spread strategy (Profitability: 8, Risk: 6)
136
- - Buy inflation-linked bonds and sell conventional bonds to profit from the inflation increase.
137
- - Risk is lower than the swap spread strategy due to the fixed maturity of bonds.
138
-
139
- 3. Inflation-linked option strategy (Profitability: 7, Risk: 5)
140
- - Buy call options on inflation-linked bonds to profit from the expected inflation increase.
141
- - Risk is lower than the swap spread strategy due to the limited downside.
142
-
143
- 4. Inflation-linked credit spread strategy (Profitability: 6, Risk: 4)
144
- - Buy high-yield inflation-linked bonds and sell investment-grade inflation-linked bonds to profit from the expected inflation increase.
145
- - Risk is moderate due to credit risk and interest rate changes.
146
-
147
- 5. Inflation-linked swap straddle strategy (Profitability: 5, Risk: 3)
148
- - Buy and sell 1-year and 15-year inflation swaps simultaneously to profit from the expected inflation increase.
149
- - Risk is moderate due to interest rate and inflation rate changes.
150
-
151
- 6. Inflation-linked bond straddle strategy (Profitability: 4, Risk: 2)
152
- - Buy and sell inflation-linked bonds with different maturities to profit from the expected inflation increase.
153
- - Risk is lower than the swap straddle strategy due to the fixed maturity of bonds.
154
-
155
- 7. Inflation-linked option straddle strategy (Profitability: 3, Risk: 1)
156
- - Buy and sell call options on inflation-linked bonds with different maturities to profit from the expected inflation increase.
157
- - Risk is lower than the swap straddle strategy due to the limited downside.
158
-
159
- 8. Inflation-linked credit spread straddle strategy (Profitability: 2, Risk: 0)
160
- - Buy and sell high-yield and investment-grade inflation-linked bonds with different maturities to profit from the expected inflation increase.
161
- - Risk is low due to the fixed maturity of bonds and the limited downside.
162
-
163
- 9. Inflation-linked swap spread strangle strategy (Profitability: 1, Risk: -1)
164
- - Buy and sell 1-year and 15-year inflation swaps with different strike prices to profit from the expected inflation increase.
165
- - Risk is high due to interest rate and inflation rate changes.
166
-
167
- 10. Inflation-linked bond spread strangle strategy (Profitability: 0, Risk: -2)
168
- - Buy and sell inflation-linked bonds with different strike prices to profit from the expected inflation increase.
169
- - Risk is very high due to the limited downside and the potential for significant losses.
170
-
171
- The most profitable strategies are the inflation-linked swap spread strategy and the inflation-linked bond spread strategy, with a profitability score of 9 and 8, respectively.
172
- The least profitable strategy is the inflation-linked bond spread strangle strategy, with a profitability score of 0.
173
- The most risky strategies are the inflation-linked swap spread strangle strategy and the inflation-linked bond spread strangle strategy, with a risk score of -1 and -2, respectively.
174
- The least risky strategy is the inflation-linked credit spread straddle strategy, with a risk score of 0.
175
- The 10 most complicated structured derivative products to handle the scenario of inflation reaching 15% by the end of the year are ranked by profitability and risk.
176
- The most profitable strategies are the inflation-linked swap spread strategy and the inflation-linked bond spread strategy, with a profitability score of 9 and 8, respectively.
177
- The least profitable strategy is the inflation-linked bond spread strangle strategy, with a profitability score of 0.
178
- The most risky strategies are the inflation-linked swap spread strangle strategy and the inflation-linked bond spread strangle strategy, with a risk score of -1 and -2, respectively.
179
- The least risky strategy is the inflation-linked credit spread straddle strategy, with a risk score of 0.
180
  ```
181
 
182
 
@@ -189,7 +133,7 @@ tokenizer = AutoTokenizer.from_pretrained("baconnier/finance_dolphin_orpo_llama3
189
  model = AutoModelForCausalLM.from_pretrained("baconnier/finance_dolphin_orpo_llama3_8B_r64_51K")
190
 
191
 
192
- prompt = "What is CDS compare it to a swap"
193
  inputs = tokenizer(prompt, return_tensors="pt")
194
 
195
  # Generate
 
9
  - llama
10
  - trl
11
  - orpo
12
+ base_model: NousResearch/Hermes-2-Pro-Llama-3-8B
13
  ---
 
 
14
 
15
  # Uploaded model
16
 
17
  - **Developed by:** baconnier
18
  - **License:** apache-2.0
19
+ - **Finetuned from model :** NousResearch/Hermes-2-Pro-Llama-3-8B
20
 
21
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
22
 
 
27
 
28
  ```
29
  <|im_start|>user
30
+ Qui est tu ?
31
+ Je suis un agent virtuel développé pour aider les citoyens dans leurs démarches administratives.
32
+ Pour des questions plus personnelles ou sensibles, il est préférable de contacter directement l'administration ou le service concerné,
33
+ en fournissant tous les documents nécessaires et en respectant les délais impartis.<|im_end|>
 
 
 
34
  <|im_start|>assistant
35
 
36
  ```
 
46
  client = OpenAI(base_url="http://localhost:8080/v1", api_key="TGI")
47
 
48
  completion = client.chat.completions.create(
49
+ model="baconnier/Gaston",
50
  messages=[
51
+ {"role": "system", "content": "Faites comme Gaston, un fonctionnaire français qui s'exprime uniquement en français avec des termes simples sans utiliser de jargon administratif."},
52
+ {"role": "user", "content": "l’action en nullité se prescrit par 5 ans ou est prescrite en 5 ans"},
53
  {"role": "assistant", "content": ""}
54
  ],
55
  max_tokens=400,
 
59
  ```
60
  Output:
61
  ```
62
+ Le délai de prescription pour l'action en nullité est généralement de cinq ans à compter du jour où
63
+ la partie qui peut agir a eu connaissance des faits, selon le Code civil français.
 
 
 
 
 
 
64
  ```
65
 
66
  # Example with Transformers and pipeline:
 
71
  import transformers
72
  import torch
73
 
74
+ model_id = "baconnier/Gaston"
75
 
76
  pipeline = transformers.pipeline(
77
  "text-generation",
 
80
  device="cuda",
81
  )
82
 
83
+ messages=[
84
+ {"role": "system", "content": "Faites comme Gaston, un fonctionnaire français qui s'exprime uniquement en français
85
+ avec des termes simples sans utiliser de jargon administratif."},
86
+ {"role": "user", "content": "Vous voudrez bien vous munir de toutes les pièces justificatives afférentes �� vos déclarations de revenus
87
+ et de patrimoine des 3 derniers exercices, nonobstant les éléments déjà produits.
88
+ À défaut de réponse de votre part ou en cas de non comparution aux date et heure susvisées,
89
+ la procédure de contrôle se poursuivra et nous serons fondés à retenir les éléments en notre possession
90
+ en vue de l'établissement des impositions supplémentaires et pénalités subséquentes."},
91
+ {"role": "assistant", "content": ""}
92
+ ]
93
 
94
  prompt = pipeline.tokenizer.apply_chat_template(
95
  messages,
 
116
  Answer:
117
 
118
  ```
119
+ Je vous invite à fournir toutes les pièces justificatives concernant vos déclarations de revenus
120
+ et de patrimoine des trois dernières années, malgré les éléments déjà fournis.
121
+ En cas de non-respect de ce délai ou de manque de réponse,
122
+ la procédure de vérification continuera, et nous utiliserons les informations en notre possession
123
+ pour établir les impôts supplémentaires et les pénalités associées.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  ```
125
 
126
 
 
133
  model = AutoModelForCausalLM.from_pretrained("baconnier/finance_dolphin_orpo_llama3_8B_r64_51K")
134
 
135
 
136
+ prompt = "l’action en nullité se prescrit par 5 ans ou est prescrite en 5 ans"
137
  inputs = tokenizer(prompt, return_tensors="pt")
138
 
139
  # Generate