--- language: - en - hi license: llama2 library_name: transformers tags: - hindi - 'english ' - Bilingual datasets: - sarvamai/samvaad-hi-v1 pipeline_tag: text-generation model-index: - name: Gaja-v1.00 results: - task: type: text-generation name: Text Generation dataset: name: AI2 Reasoning Challenge (25-Shot) type: ai2_arc config: ARC-Challenge split: test args: num_few_shot: 25 metrics: - type: acc_norm value: 52.82 name: normalized accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: HellaSwag (10-Shot) type: hellaswag split: validation args: num_few_shot: 10 metrics: - type: acc_norm value: 76.31 name: normalized accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: MMLU (5-Shot) type: cais/mmlu config: all split: test args: num_few_shot: 5 metrics: - type: acc value: 40.83 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: TruthfulQA (0-shot) type: truthful_qa config: multiple_choice split: validation args: num_few_shot: 0 metrics: - type: mc2 value: 44.64 source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: Winogrande (5-shot) type: winogrande config: winogrande_xl split: validation args: num_few_shot: 5 metrics: - type: acc value: 70.64 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: GSM8k (5-shot) type: gsm8k config: main split: test args: num_few_shot: 5 metrics: - type: acc value: 0.91 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=damerajee/Gaja-v1.00 name: Open LLM Leaderboard --- # Model # ЁЯРШ Gaja Gaja is a Hindi/Hinglish chat model, initially trained on SarvamAI's OpenHathi model and further fine-tuned for conversational interactions. Image # Additional Information - It outperforms Airavata, AI4Bharat's chat version, on Huggingface OpenLLM benchmark suite. - It was fine-tuned on only 1k samples - The code for this can be found in The github code - [Github](https://github.com/dame-cell/Gaja) # ЁЯТм Prompt template ``` <|im_start|>user {}<|im_end|> <|im_start|>assistant {}<|im_end|> ``` # ЁЯШО Features: - Language Support: Gaja is designed to understand and generate responses in both Hindi and Hinglish, catering to a diverse range of users. - Base Model: Built upon SarvamAI's OpenHathi model, Gaja inherits its foundational capabilities while being optimized for conversational tasks. - Fine-tuning: Gaja has undergone fine-tuning specifically for chat-based interactions, enhancing its ability to engage in meaningful conversations with users. - Experimental Platform: With its flexibility and adaptability, Gaja serves as a valuable platform for conducting experiments and exploring innovative approaches to chatbot development. # ЁЯШд Example Output | User | Assistant | |--------------------------------------------------|------------------------------------------------------------------------------------------------------------------------| | what is a large language model | рдПрдХ рдмрдбрд╝рд╛ рднрд╛рд╖рд╛ рдореЙрдбрд▓, рдЬрд┐рд╕реЗ ML рдпрд╛ LLM рдХреЗ рд░реВрдк рдореЗрдВ рднреА рдЬрд╛рдирд╛ рдЬрд╛рддрд╛ рд╣реИ, рдПрдХ рдкреНрд░рдХрд╛рд░ рдХрд╛ рдПрдЖрдИ рдПрд▓реНрдЧреЛрд░рд┐рдереНрдо рд╣реИ рдЬреЛ рдорд╛рдирд╡ рднрд╛рд╖рд╛ рдХреЛ рд╕рдордЭрдиреЗ рдФрд░ рд╕рдордЭрдиреЗ рдореЗрдВ рдирд┐рдкреБрдг рд╣реИред рдпрд╣ рдПрд▓реНрдЧреЛрд░рд┐рдереНрдо рдПрдХ рдмрдбрд╝реА рдлрд┐рд▓реНрдЯрд░рд┐рдВрдЧ рдпреЛрдЬрдирд╛ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддрд╛ рд╣реИ, рдЬреЛ рдЗрд╕реЗ рдмрдбрд╝реА рдорд╛рддреНрд░рд╛ рдореЗрдВ рдбреЗрдЯрд╛ рдХреЛ рд╕рдВрд╕рд╛рдзрд┐рдд рдХрд░рдиреЗ рдХреА рдЕрдиреБрдорддрд┐ рджреЗрддрд╛ рд╣реИред рдпрд╣ рдПрд▓реНрдЧреЛрд░рд┐рдереНрдо рдПрдХ рдмрдбрд╝реЗ рдбреЗрдЯрд╛рд╕реЗрдЯ рд╕реЗ рдЬрд╛рдирдХрд╛рд░реА рдирд┐рдХрд╛рд▓рддрд╛ рд╣реИ, рдЬреЛ рдЖрдорддреМрд░ рдкрд░ рдЗрдВрдЯрд░рдиреЗрдЯ рдкрд░ рдкрд╛рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред рдпрд╣ рдПрд▓реНрдЧреЛрд░рд┐рдереНрдо рдорд╛рдирд╡ рднрд╛рд╖рд╛ рдХреЗ рдмрд╛рд░реЗ рдореЗрдВ рдЬрд╛рдирдХрд╛рд░реА рдХреЛ рд╕рдордЭрдиреЗ рдФрд░ рд╕рдордЭрдиреЗ рдХреЗ рд▓рд┐рдП рдХрдИ рдПрд▓реНрдЧреЛрд░рд┐рдердорд┐рдХ рддрд░реАрдХреЛрдВ рдХрд╛ рдЙрдкрдпреЛрдЧ рдХрд░рддрд╛ рд╣реИред рдмрдбрд╝реЗ рднрд╛рд╖рд╛ рдореЙрдбрд▓ рдХрд╛ рдЙрдкрдпреЛрдЧ рдЖрдорддреМрд░ рдкрд░ рд╕рдВрднрд╛рд╡рд┐рдд рд╕рдВрдкрд░реНрдХ, рдЕрдиреБрдкреНрд░рдпреЛрдЧреЛрдВ рдХреА рдПрдХ рд╡реНрдпрд╛рдкрдХ рд╢реНрд░реГрдВрдЦрд▓рд╛ рдореЗрдВ рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИред | | How could AI help humans? | AI can help humans in several ways. Firstly, it can assist in decision-making by providing insights and data analysis. For example, AI-powered tools can help individuals and businesses make informed decisions based on real-time data.Secondly, AI can enhance productivity by automating repetitive and mundane tasks. This frees up time and resources for more creative and strategic work.Thirdly, AI can improve healthcare by providing personalized medical diagnoses and treatment plans. AI-powered tools can analyze vast amounts of medical data and provide insights that can lead to more effective and efficient healthcare.Fourthly, AI can enhance security by detecting and preventing cyber threats. AI-powered systems can monitor networks and detect suspicious activity, preventing cyber-attacks before they occur.Lastly, AI can contribute to environmental conservation by optimizing resource utilization and reducing waste. AI-powered systems can monitor and optimize resource usage, leading to more sustainable practices.In summary, AI can help humans by enhancing decision-making, increasing productivity, improving healthcare, enhancing security, and contributing to environmental conservation. | | рдХреНрдпрд╛ рдЖрдк рдореБрдЭреЗ рдмрддрд╛ рд╕рдХрддреЗ рд╣реИрдВ рдХрд┐ рднрд╛рд░рдд рдореЗрдВ рд▓реЛрдЧ рдмрдбрд╝реЛрдВ рдХреЗ рдкреИрд░ рдЫреВрддреЗ рдХреНрдпреЛрдВ рд╣реИрдВ? | рднрд╛рд░рдд рдореЗрдВ, рдмрдбрд╝реЛрдВ рдХреЗ рдкреИрд░ рдЫреВрдирд╛ рдПрдХ рдЖрджрдореА рдХреА рдмрдбрд╝реЛрдВ рдХреЗ рдкреНрд░рддрд┐ рд╢реНрд░рджреНрдзрд╛ рдФрд░ рд╕рдореНрдорд╛рди рджрд┐рдЦрд╛рдиреЗ рдХреА рдПрдХ рдкрд╛рд░рдВрдкрд░рд┐рдХ рдкреНрд░рдерд╛ рд╣реИред рдпрд╣ рдЖрджрдореА рдмрдбрд╝реЛрдВ рдХреЛ рдЖрджрд░ рдФрд░ рдЖрддреНрдорд╕рд╛рдд рдХрд░рддрд╛ рд╣реИред рдпрд╣ рдПрдХ рдЖрджрдореА рдХреЗ рдмрдбрд╝реЛрдВ рдХреЗ рд╕рд╛рде рдЕрдкрдиреЗ рд╕рдВрдмрдВрдз рдХреЛ рд╕реНрдерд╛рдкрд┐рдд рдХрд░рдиреЗ рдФрд░ рдмрдбрд╝реЛрдВ рдХреЗ рдкреНрд░рддрд┐ рдЕрдкрдиреА рд╢реНрд░рджреНрдзрд╛ рдФрд░ рдЖрддреНрдорд╕рд╛рдд рдХреЛ рджрд░реНрд╢рд╛рд┐рдд рдХрд░рдиреЗ рдХрд╛ рдПрдХ рддрд░реАрдХрд╛ рд╣реИред рдпрд╣ рдПрдХ рдЖрджрдореА рдХреЗ рдмрдбрд╝реЛрдВ рдХреЗ рд╕рд╛рде рдЕрдкрдиреЗ рдШрдирд┐рд╖реНрда рд╕рдВрдмрдВрдз рдХреЛ рд╕реНрдерд╛рдкрд┐рдд рдХрд░рдиреЗ рдФрд░ рдмрдбрд╝реЛрдВ рдХреЗ рдкреНрд░рддрд┐ рдЕрдкрдиреА рдЖрддреНрдорд╛рддреНрдордХрддрд╛ рдФрд░ рдЖрддреНрдорд╕рд╛рдд рдХреЛ рджрд░реНрд╢рд╛рд┐рдд рдХрд░рдиреЗ рдХрд╛ рдПрдХ рддрд░реАрдХрд╛ рд╣реИред| # Eval ### Hindi eval | Task | #Samples | Accuracy | Precision | F1 | Recall | Metrics | |------------------------|----------|----------|-----------|------|--------|----------------------------| | Indic-Sentiment Analysis | 100 | 0.71 | - | 0.76 | - | Accuracy, F1 score | | Indic-QA Evaluation | 50 | - | 0.62 | 0.68 | 0.75 | Bert Score | | Indic-NLI | 50 | 0.24 | - | 0.17 | - | Accuracy, F1 score | | Indic-Paraphrase | 500 | 0.52 | 0.49 | 0.48 | - | Accuracy, F1 score, Precision | ### English eval Model name| Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K| |-------|------------------------|-----------|----------|-----------|------|--------|------------| | [damerajee/Gaja-v1.00](https://huggingface.co/damerajee/Gaja-v1.00)| 47.69 | 52.82 | 76.31 | 40.83 | 44.64 | 70.64 | 0.91 | | [manishiitg/open-aditi-hi-v2](https://huggingface.co/manishiitg/open-aditi-hi-v2) | 59.31 | 59.39 | 82.01 | 61.41 | 45.84 | 77.19 | 30.02 | | [ai4bharat/Airavata](https://huggingface.co/ai4bharat/Airavata) | 45.52 | 46.5 | 69.26 | 43.9 | 40.62 | 68.82 | 4.02 | ![Screenshot (30).png](https://cdn-uploads.huggingface.co/production/uploads/6487239cca30096ea9f52115/ip_xYv7XpC68RKq7P-Qt-.png) # ЁЯЪА Infernce(colab or kaggle notebooks) ### Installing dependencies ```python !pip install -q peft bitsandbytes datasets accelerate ``` ### Load the model ```python from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("damerajee/Gaja-v1.00") model = AutoModelForCausalLM.from_pretrained("damerajee/Gaja-v1.00",load_in_4bit=True) ``` ### Try it out ```python messages = [ {"role": "user", "content": "Why do poeple in India touch the feet of elders when they greet them?"}, ] inputs = tokenizer.apply_chat_template( messages, tokenize = True, add_generation_prompt = True, # Must add for generation return_tensors = "pt", ).to("cuda") from transformers import TextStreamer text_streamer = TextStreamer(tokenizer) _ = model.generate(input_ids = inputs, streamer = text_streamer, max_new_tokens = 300, use_cache = True) ``` # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_damerajee__Gaja-v1.00) | Metric |Value| |---------------------------------|----:| |Avg. |47.69| |AI2 Reasoning Challenge (25-Shot)|52.82| |HellaSwag (10-Shot) |76.31| |MMLU (5-Shot) |40.83| |TruthfulQA (0-shot) |44.64| |Winogrande (5-shot) |70.64| |GSM8k (5-shot) | 0.91|