thonypythony commited on
Commit
e80c8a1
·
verified ·
1 Parent(s): 6012b22
Files changed (7) hide show
  1. .gitattributes +4 -0
  2. car.png +3 -0
  3. describe_and_neurogenerate_image.py +39 -0
  4. i.png +3 -0
  5. neurocar.png +3 -0
  6. neuroi.png +3 -0
  7. requirements.txt +55 -0
.gitattributes CHANGED
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ car.png filter=lfs diff=lfs merge=lfs -text
37
+ i.png filter=lfs diff=lfs merge=lfs -text
38
+ neurocar.png filter=lfs diff=lfs merge=lfs -text
39
+ neuroi.png filter=lfs diff=lfs merge=lfs -text
car.png ADDED

Git LFS Details

  • SHA256: fc81381082dfba8fb38afa4a35ef7bf0fcd92594bbdaa290885d0d5ac341961d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.14 MB
describe_and_neurogenerate_image.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # source TORCHTEST/bin/activate
2
+
3
+ # pip install --upgrade pip
4
+ # pip install ollama transformers
5
+ # pip install --upgrade diffusers[torch]
6
+
7
+ from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler, FluxPipeline
8
+ import torch
9
+ import ollama
10
+
11
+ original_image = 'p.jpg'
12
+
13
+ response = ollama.chat(
14
+ model='gemma3:4b',
15
+ messages=[{
16
+ 'role': 'user',
17
+ 'content': 'What is in this image? Describe in the details',
18
+ 'images': [original_image]
19
+ }],
20
+ options={
21
+ 'temperature': 0.4, # значение от 0,0 до 0,9 (или 1) определяет уровень креативности модели или ее неожиданных ответов.
22
+ #'top_p': 0.9, # от 0,1 до 0,9 определяет, какой набор токенов выбрать, исходя из их совокупной вероятности.
23
+ #'top_k': 90, # от 1 до 100 определяет, из скольких лексем (например, слов в предложении) модель должна выбрать, чтобы выдать ответ.
24
+ #'num_ctx': 500_000, # устанавливает максимальное используемое контекстное окно, которое является своего рода областью внимания модели.
25
+ 'num_predict': 250, # задает максимальное количество генерируемых токенов в ответах для рассмотрения (100 tokens ~ 75 words).
26
+ }
27
+ )
28
+
29
+ pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-2-base", torch_dtype=torch.float16, variant="fp16")
30
+
31
+ # pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-schnell", torch_dtype=torch.bfloat16) # Access to model black-forest-labs/FLUX.1-schnell is restricted. You must have access to it and be authenticated to access it. Please log in.
32
+
33
+ pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
34
+ pipe = pipe.to("cuda")
35
+
36
+ prompt = response.message.content
37
+ print(f"Полученный запрос: {prompt}")
38
+ image = pipe(prompt, num_inference_steps=25).images[0]
39
+ image.save(f'neuro{original_image[:-4]}.png')
i.png ADDED

Git LFS Details

  • SHA256: fc7ad01a94e572d1beacf28d26793af2b6abeac7b6cba070affbf94e68ab4d04
  • Pointer size: 132 Bytes
  • Size of remote file: 1.77 MB
neurocar.png ADDED

Git LFS Details

  • SHA256: ffb5bdb9f085ec8bb38f9fd94f551fc42be483d3c3483f518ea87277ba9ed83d
  • Pointer size: 131 Bytes
  • Size of remote file: 371 kB
neuroi.png ADDED

Git LFS Details

  • SHA256: 7968d767438bd87aeed27e5fb1e01000c106b288bac45d21d25c2f14d3704acd
  • Pointer size: 131 Bytes
  • Size of remote file: 554 kB
requirements.txt ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ accelerate==1.7.0
2
+ annotated-types==0.7.0
3
+ anyio==4.9.0
4
+ certifi==2025.4.26
5
+ charset-normalizer==3.4.2
6
+ diffusers==0.33.1
7
+ exceptiongroup==1.3.0
8
+ filelock==3.13.1
9
+ fsspec==2024.2.0
10
+ h11==0.16.0
11
+ hf-xet==1.1.3
12
+ httpcore==1.0.9
13
+ httpx==0.28.1
14
+ huggingface-hub==0.32.4
15
+ idna==3.10
16
+ importlib_metadata==8.7.0
17
+ Jinja2==3.1.3
18
+ MarkupSafe==2.1.5
19
+ mpmath==1.3.0
20
+ networkx==3.2.1
21
+ numpy==1.26.3
22
+ nvidia-cublas-cu11==11.11.3.6
23
+ nvidia-cuda-cupti-cu11==11.8.87
24
+ nvidia-cuda-nvrtc-cu11==11.8.89
25
+ nvidia-cuda-runtime-cu11==11.8.89
26
+ nvidia-cudnn-cu11==9.1.0.70
27
+ nvidia-cufft-cu11==10.9.0.58
28
+ nvidia-curand-cu11==10.3.0.86
29
+ nvidia-cusolver-cu11==11.4.1.48
30
+ nvidia-cusparse-cu11==11.7.5.86
31
+ nvidia-nccl-cu11==2.21.5
32
+ nvidia-nvtx-cu11==11.8.86
33
+ ollama==0.5.1
34
+ packaging==25.0
35
+ pillow==10.2.0
36
+ psutil==7.0.0
37
+ pydantic==2.11.5
38
+ pydantic_core==2.33.2
39
+ PyYAML==6.0.2
40
+ regex==2024.11.6
41
+ requests==2.32.4
42
+ safetensors==0.5.3
43
+ sniffio==1.3.1
44
+ sympy==1.13.1
45
+ tokenizers==0.21.1
46
+ torch==2.5.1+cu118
47
+ torchaudio==2.5.1+cu118
48
+ torchvision==0.20.1+cu118
49
+ tqdm==4.67.1
50
+ transformers==4.52.4
51
+ triton==3.1.0
52
+ typing-inspection==0.4.1
53
+ typing_extensions==4.14.0
54
+ urllib3==2.4.0
55
+ zipp==3.23.0