Views
No views yet
1from lorax import Client
2
3client = Client("http://<your_endpoint>")
4
5content = "<your news story>"
6
7prompt = f"""
8The following passage is content from a news report. Please summarize this
9passage in one sentence or less.
10
11Passage: {content}
12
13Summary:
14"""
15
16adapter_id = "tgaddair/mistral-7b-tldrnews-headlines-lora-r8"
17resp = client.generate(prompt, max_new_tokens=64, adapter_id=adapter_id)
18print(resp.generated_text)1model_type: llm
2input_features:
3 - name: prompt
4 type: text
5 preprocessing:
6 max_sequence_length: null
7 column: prompt
8output_features:
9 - name: headline
10 type: text
11 preprocessing:
12 max_sequence_length: null
13 column: headline
14prompt:
15 template: >-
16 The following passage is content from a news report. Please summarize this
17 passage in one sentence or less.
18
19
20 Passage: {content}
21
22
23 Summary:
24preprocessing:
25 split:
26 type: fixed
27 column: split
28 global_max_sequence_length: 2048
29adapter:
30 type: lora
31generation:
32 max_new_tokens: 64
33trainer:
34 type: finetune
35 epochs: 3
36 optimizer:
37 type: paged_adam
38 batch_size: 1
39 eval_steps: 100
40 learning_rate: 0.0002
41 eval_batch_size: 2
42 steps_per_checkpoint: 1000
43 learning_rate_scheduler:
44 decay: cosine
45 warmup_fraction: 0.03
46 gradient_accumulation_steps: 16
47 enable_gradient_checkpointing: true
48base_model: mistralai/Mistral-7B-v0.1
49quantization:
50 bits: 4