Update README.md
Browse files
README.md
CHANGED
|
@@ -64,6 +64,24 @@ pipe = pipeline("text-generation",
|
|
| 64 |
pad_token_id=tokenizer.eos_token_id,
|
| 65 |
)
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
```
|
| 68 |
|
| 69 |
If you are having a memory problem such as "CUDA Out of memory", you should use 4-bit or 8-bit quantization.
|
|
|
|
| 64 |
pad_token_id=tokenizer.eos_token_id,
|
| 65 |
)
|
| 66 |
|
| 67 |
+
|
| 68 |
+
def format_question(input:str)-> str:
|
| 69 |
+
base_instruction = """Abaixo está uma instrução que descreve uma tarefa, juntamente com uma entrada que fornece mais contexto. Escreva uma resposta que complete adequadamente o pedido."""
|
| 70 |
+
falcon_input = f"""<s>[INST] <<SYS>>\n {base_instruction}
|
| 71 |
+
<</SYS>> {input} [/INST]
|
| 72 |
+
"""
|
| 73 |
+
|
| 74 |
+
return falcon_input.strip()
|
| 75 |
+
|
| 76 |
+
prompt = "Me explique sobre os romanos em até 5 frases"
|
| 77 |
+
prompt = format_question(prompt)
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
```text
|
| 81 |
+
Os romanos foram um povo que viveu na Itália antiga, entre o século VIII a.C. e o século V d.C.
|
| 82 |
+
Eles eram conhecidos por sua habilidade em construir estradas, edifícios e aquedutos, e também por suas conquistas militares.
|
| 83 |
+
O Império Romano, que durou de 27 a.C. a 476 d.C., foi o maior império da história, abrangendo uma área que ia da Grécia até a Inglaterra.
|
| 84 |
+
Os romanos também desenvolveram um sistema de leis e instituições políticas que influenciaram profundamente a cultura ocidental.
|
| 85 |
```
|
| 86 |
|
| 87 |
If you are having a memory problem such as "CUDA Out of memory", you should use 4-bit or 8-bit quantization.
|