Views
No views yet
gemma-3n-E2B-it, has been specifically fine-tuned to understand the complex language, nuances, and key concepts within graphene-related scientific abstracts. It serves as a specialized tool to accelerate the research process through precise data extraction, summarization, and question answering.google/gemma-3n-E2B-itq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj) to adapt the model to the specific domain while preserving its core capabilities.bf16 precision for stability and speed, with the adamw_8bit optimizer.1from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
2import torch
3
4model_id = "Shinapri/Matellem-Gemma3n-E2B-Graphene-1"
5
6model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto").eval()
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8
9INSTRUCTION = "You are a scientific literature search expert. Your task is to suggest a likely title for a research paper based on the user's description."
10USER_INPUT = """I'm trying to recall the title of a review paper I read.
11It discussed the applications of graphene specifically in the field of neuroscience,
12covering two main areas: its use as a carrier for drug delivery and as a conductive substrate for tissue engineering.
13Can you suggest a likely title?"""
14
15messages = [
16 {"role": "system", "content": [{"type": "text", "text": INSTRUCTION}]},
17 {"role": "user", "content": [{"type": "text", "text": USER_INPUT}]},
18]
19
20prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
21inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
22
23streamer = TextStreamer(tokenizer, skip_prompt=True)
24
25with torch.no_grad():
26 _ = model.generate(
27 **inputs,
28 streamer=streamer,
29 do_sample=True,
30 max_new_tokens=1024,
31 top_p=0.9,
32 temperature=0.7
33 )> Based on your description, a likely title for the review paper is: **Graphene in Neuroscience: Applications in Drug Delivery and Tissue Engineering**intfloat/e5-large model.