SSブログ

冬桜 [相鉄沿線]

冬桜が咲いていました。

今年は、10月になっても暖かい日が続いたせいか、例年なら春にしか咲かないこども自然公園の一本桜にも花が咲いていました。



サツキも花盛り


北国からやってきたキンクロハジロは、日影で涼んでいます。







nice!(19)  コメント(0) 

逗子海岸 [湘南・鎌倉]

先週、ひさしぶりに逗子海岸に行きました。





nice!(15)  コメント(0) 

秋バラ [ヨコハマ]

秋バラの季節になりました。

山手イタリア山庭園





イングリッシュローズの庭


山下公園
山下公園のバラ


氷川丸とバラ

赤い靴の女の子と豪華客船



今週のチョットGPT
HuggingFaceからzephyr-7b-alpha というモデルが公開されました。
7B(70億パラメータ)のモデルですが、10倍ほどサイズが大きいChat Llama 70Bと同じくらいの性能があるらしいです。
https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha

8bit量子化すると14GB程度のGPUメモリで動かせます。
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
import torch

model_id = "HuggingFaceH4/zephyr-7b-alpha"
quantization_config = BitsAndBytesConfig(
    load_in_8bit=True,
    torch_dtype=torch.bfloat16
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    quantization_config=quantization_config,
    trust_remote_code=True,
    device_map="auto"
)

messages = [
    {"role": "user", "content": "日本の国花は何ですか?"},
    {"role": "assistant", "content": "日本の国花は、桜です。"},
    {"role": "user", "content": "何故多くの日本人は、桜が好きなのですか?"}
]

encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")

model_inputs = encodeds.to(device)

generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])

多くの日本人がチーレアスレースに好きである場合を例にします。これは、広告上で人気を集められるとの理由がありますからです。このような場合、広告の効果を高めるために、主幹に集められる必要性があります。 桜の場合、日本の伝統、風化、文化的な價値が非常に高いため、多くの人々が好きなこともあります。桜は、国家の祭典以外にも、学校、団体などで祭りになります。そのために、桜をもつことがお世話になり、これを愛を受けるものとして信じていることが多いです。そのため、桜がポピュラーな原因にあり、多くの人々が好きな理由を持っています。


日本語は、苦手なのかな?


<|user|> Quel est le plus long fleuve du monde ?
<|assistant|> Le plus long fleuve du monde est le Nil, qui coule sur une distance de 6 650 kilomètres (km) à travers l'Afrique. Il naît dans les hautes terres d'Éthiopie sous le nom de Blue Nile, se joint au White Nile à Khartoum sous le nom de Nil, et se jette dans la mer Rouge après avoir traversé l'Égypte.
フランス語は、できるみたい。

<|user|> What does Zephyr mean ?
<|assistant|> Zephyr is the name of a gentle, soft, and calming breeze in Greek mythology. The word derives from the Greek word ZEPHYROS, which means "west wind." In literature, Zephyr is often personified as a god, goddess, or spirit, who brings peace and tranquility. Outside of mythology, the word zephyr is still used today to refer to a light and refreshing wind, particularly in meteorology.
「ゼファーはギリシャ神話に登場する、穏やかで柔らかく、心を落ち着かせるそよ風の名前である。ギリシャ語で "西風 "を意味するZEPHYROSが語源である。文学では、ゼファーはしばしば平和と静けさをもたらす神、女神、精霊として擬人化される。神話以外では、ゼファーという言葉は今日でも、特に気象学において、軽やかで爽やかな風を指す言葉として使われている。」

「女神、精霊として擬人化される。」と答えていますが、Zephyrosは、花の女神フローラの恋人で男性ですね。ちょっと残念。

ちなみに、日本では西風(にし)は、秋の季語ですが、西洋では、西風(Zephyr) は、早春に吹くそよ風のことらしいです。

IZephyr : 西風

nice!(12)  コメント(0) 

見頃になりました。 [相鉄沿線]

追分市民の森のコスモス畑
見頃になりました。








コスモス畑の近くで栗を買いました。




今週のチョットGPT
画像と文を使って、会話ができる、LLaVAというのを試してみました。
LLaVA: Large Language and Vision Assistant
Visual instruction tuning towards large language and vision models with GPT-4 level capabilities
https://github.com/haotian-liu/LLaVA

このページの最初のコスモス畑の写真を使って、会話してみました。
(llava) tama@chotGPT:~/LLM/LLaVA$ python -m llava.serve.cli \
--model-path liuhaotian/llava-v1.5-7b \
--image-file "images/IMG_0626.jpg" \
--load-4bit
[2023-10-08 15:52:55,297] [INFO] [real_accelerator.py:110:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Loading checkpoint shards: 100%|██████████████████████████████████████████████████████████| 2/2 [00:08<00:00, 4.29s/it]
USER: Today I went to a cosmos field in my neighborhood.
ASSISTANT: It sounds like you had a pleasant experience at the cosmos field in your neighborhood. The field is filled with a variety of flowers, including pink and purple ones, creating a beautiful and vibrant scene. The presence of many flowers in the field suggests that it is a popular spot for visitors to enjoy the natural beauty and tranquility of the area. It's great that you decided to visit the field and appreciate the beauty of the flowers and the surrounding environment.
USER:
exit...



nice!(16)  コメント(0) 

今週のコスモス畑 [相鉄沿線]

追分市民の森のコスモス畑
来週ぐらいが見頃かな







nice!(17)  コメント(0)