RichardErkhov commited on
Commit
0c59f89
·
verified ·
1 Parent(s): bf3dcf3

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +109 -0
README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ TinyLlama-ContextQuestionPair-Classifier-Reranker - bnb 4bits
11
+ - Model creator: https://huggingface.co/cnmoro/
12
+ - Original model: https://huggingface.co/cnmoro/TinyLlama-ContextQuestionPair-Classifier-Reranker/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ license: cc-by-nc-2.0
20
+ language:
21
+ - en
22
+ - pt
23
+ tags:
24
+ - classification
25
+ - llama
26
+ - tinyllama
27
+ - rag
28
+ - rerank
29
+ ---
30
+ ```python
31
+ template = """<s><|system|>
32
+ You are a chatbot who always responds in JSON format indicating if the context contains relevant information to answer the question</s>
33
+ <|user|>
34
+ Context:
35
+ {Text}
36
+
37
+ Question:
38
+ {Prompt}</s>
39
+ <|assistant|>
40
+ """
41
+
42
+ # Output should be:
43
+
44
+ {"relevant": true}
45
+
46
+ # or
47
+
48
+ {"relevant": false}
49
+ ```
50
+
51
+ Example:
52
+ ```text
53
+ <s><|system|>
54
+ You are a chatbot who always responds in JSON format indicating if the context contains relevant information to answer the question</s>
55
+ <|user|>
56
+ Context:
57
+ old. NFT were observed in almost all patients over 60 years of age, but the incidence was low.
58
+ Many ubiquitin-positive small-sized granules were observed in the second and third layer of the parahippocampal gyrus of aged patients,
59
+ and the incidence rose with increasing age. On the other hand, few of these granules were in patients with Alzheimer\'s type dementia.
60
+ Granulovacuolar degeneration was examined. Many centrally-located granules were positive for ubiquitin. Based on electron microscopic
61
+ observation of these granules at several stages, the granules were thought to be a type of autophagosome. During the first stage of
62
+ granulovacuolar degeneration, electron-dense materials appeared in the cytoplasm, following which they were surrounded by smooth cytoplasm,
63
+ following which they were surrounded by smooth endoplasmic reticulum. Analytical electron microscopy disclosed that the granules contained
64
+ some aluminium. Several senile changes in the central nervous system in cadavers were examined. The pattern of extension of Alzheimer\'s
65
+ neurofibrillary tangles (NFT) and senile plaques (SP) in the olfactory bulbs of 100 specimens was examined during routine autopsy by
66
+ immunohistochemical staining. NFT were first observed in the anterior olfactory nucleus after the age of 60, and incidence rose with
67
+ increasing age. Senile plaques were found in the nucleus when there were many SP in the cerebral cortex. Of 25 non-demented amyotrophic
68
+ lateral sclerosis patients, SP were found in the cerebral cortices of 10, and 9 of 10 were over 60 years old. NFT were observed in almost
69
+ all patients over
70
+
71
+ Question:
72
+ What is granulovacuolar degeneration and what was its observation on electron microscopy?</s>
73
+ <|assistant|>
74
+ {"relevant": true}</s>
75
+ ```
76
+
77
+ vLLM recommended request parameters:
78
+
79
+ ```python
80
+ prompt = "<s><|system|>\nYou are a chatbot who always responds in JSON format indicating if the context contains relevant information to answer the question</s>\n<|user|>\nContext:\nConhecida como missão de imagem de raios-x e espectroscopia (da sigla em inglês XRISM), a estratégia é utilizar o telescópio para ampliar os estudos da humanidade a níveis celestiais com uma fração dos pixels da tela de um Gameboy original, lançado em 1989. Isso é possível por meio de uma ferramenta chamada “Resolve”. Apesar de utilizar a medição em pixels, a tecnologia é bastante diferente de uma câmera. Com um conjunto de microcalorímetros de seis pixels quadrados que mede 0,5 cm², ela detecta a temperatura de cada raio-x que o atinge. Como funciona o Resolve do telescópio XRISM? Cientista do projeto XRISM da NASA, Brian Williams explicou em um comunicado o funcionamento do telescópio. “Chamamos o Resolve de espectrômetro de microcalorímetros porque cada um de seus 36 pixels está medindo pequenas quantidades de calor entregues por cada raio-x recebido, nos permitindo ver as impressões digitais químicas dos elementos que compõem as fontes com detalhes sem precedentes”.\n\nQuestion:\nQual é a sigla em alemão mencionada?</s>\n<|assistant|>\n{\"relevant\":"
81
+
82
+ headers = {
83
+ "Accept": "text/event-stream",
84
+ "Authorization": "Bearer EMPTY"
85
+ }
86
+
87
+ body = {
88
+ "model": model,
89
+ "prompt": [prompt],
90
+ "best_of": 5,
91
+ "max_tokens": 1,
92
+ "temperature": 0,
93
+ "top_p": 1,
94
+ "use_beam_search": True,
95
+ "top_k": -1,
96
+ "min_p": 0,
97
+ "repetition_penalty": 1,
98
+ "length_penalty": 1,
99
+ "min_tokens": 1,
100
+ "logprobs": 1
101
+ }
102
+
103
+ result = requests.post(base_uri, headers=headers, json=body)
104
+ result = result.json()
105
+
106
+ boolean_response = bool(eval(json_result['choices'][0]['text'].strip().title()))
107
+ print(boolean_response)
108
+ ```
109
+