File size: 2,724 Bytes
769f5f6
 
4927d88
 
 
 
 
 
 
 
769f5f6
 
4927d88
769f5f6
 
4927d88
 
 
769f5f6
4927d88
769f5f6
4927d88
769f5f6
 
 
4927d88
 
 
 
 
769f5f6
4927d88
769f5f6
 
 
4927d88
769f5f6
 
 
213f666
4927d88
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9714152
 
 
 
4927d88
 
 
 
 
 
 
 
769f5f6
 
4927d88
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
library_name: transformers
license: apache-2.0
language:
- fa
pipeline_tag: text-generation
tags:
- neura
- medical
- DrNeura
---

# Neura Orca Gemma 7B


<p align="center">
  <img src="neura_gemma.png" width=512 height=256 />
</p>

<!-- Provide a quick summary of what the model is/does. -->

## Model Description

<!-- Provide a longer summary of what this model is. -->

- **Developed by:** Neura company
- **Funded by:** Neura
- **Model type:** gemma7b
- **Language(s) (NLP):** Persian
- **Finetuned from model:** google/gemma-7b-it

### Model Sources

<!-- Provide the basic links for the model. -->

- **Repository:** https://huggingface.co/google/gemma-7b-it

## Uses

Check out the Google Colab demo to run NeuraOrcaGemma7b on a free-tier Google Colab instance: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1SfY_jA4WKD_7JaRenaZBAzI9Hh2qbivs)


make sure these packages are installed:
```
!pip install --no-deps xformers accelerate bitsandbytes
!pip install -q -U transformers
```
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
import os
MODEL_PATH = "Neurai/NeuraMedicalGemma7b"
quantization_config = BitsAndBytesConfig(
    load_in_4bit = True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16,
    bnb_4bit_use_double_quant=True,
)

model = AutoModelForCausalLM.from_pretrained(
    MODEL_PATH,
    device_map = "auto",
    trust_remote_code = True,
    quantization_config=quantization_config,
)

tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)

input_prompt = """
### Instruction:{}
### Input:{}
### Response:{}"""

input_text = input_prompt.format(
        "انگشت شصت دستم با درد باز میشود عکس ام آر آی هم گرفتم اثری از شکستگی نیست تشخیص تو چیه؟", 
        "", 
        ""
    )

inputs = tokenizer([input_text], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 300, use_cache = True)
response = tokenizer.batch_decode(outputs)[0]
```
Generated text :
```
 بر اساس علائم و نتایج تصویربرداری،
 به نظر می‌رسد که شما ممکن است از سندرم تونل کارپال رنج ببرید.
 این وضعیت زمانی رخ می دهد که عصب مدیان در مچ دست شما فشرده یا فشرده می شود.
 در مورد شما، ممکن است که ضربه به انگشت شست شما باعث این فشردگی شده باشد. <eos>
```


## More Information
https://neura.info

## Model Card Authors
Esmaeil Zahedi, Mohsen Yazdinejad

## Model Card Contact
[email protected]