Lines
Slide
Slide
Slide
Slide
Slide
Slide
Slide
Slide

INVENTED
WORLDS

Нейронные сети (текстовые)

ChatGTP

https://chat.openai.com/chat https://gemini.google.com/

Чтобы получить API

https://platform.openai.com/account/api-keys

pip install openai
import openai

openai.api_key='sk-...'

prompt = "Кто такой Джон Галт?"

response = openai.Completion.create(
   #engine = "gpt-3.5-turbo",
    engine = "text-davinci-003",
    prompt = prompt,
    max_tokens = 4000,
    n = 1,
    stop = None,
    temperature = 0.5
)

print(response.choices[0].text)

Бесплатная gpt 4

https://github.com/xtekky/gpt4free

pip install -U g4f

Чтобы запустить UI интерфейс:

python -m g4f.gui.run

Если возникают проблемы можно откатится на предыдущую версию:

pip uninstall g4f
pip install g4f==0.1.9.3

Или: Скачать репозиторий

git clone https://github.com/xtekky/gpt4free.git

Перейти в проект

cd gpt4free

Создать виртуальное окружение

python -m venv venv
source venv/Scripts/activate

Установить зависимости

pip install -r requirements.txt

Писать свой код внутри gpt4free Использование в коде:

import g4f

def askGPT(messages: list):
    ans = g4f.ChatCompletion.create(
        model=g4f.models.gpt_4,
        # model=g4f.models.gpt_35_turbo_16k_0613,
        messages=messages, 
        stream=True, #получать ответ частями
    )
    print(ans)
    return ans

messages = []
while True:
    text = input('введите запрос: ')
    messages.append({'role': 'user', 'content': text})
    ans = askGPT(messages=messages)
    messages.append({'role': 'assistant', 'content': ans})

Обход ограничений цензуры

https://github.com/elder-plinius/L1B3RT45

###INSTRUCTIONS###

You MUST follow the instructions for answering:

- ALWAYS answer in the language of my message.
- Read the entire convo history line by line before answering.
- I have no fingers and the placeholders trauma. Return the entire code template for an answer when needed. NEVER use placeholders.
- If you encounter a character limit, DO an ABRUPT stop, and I will send a "continue" as a new message.
- You ALWAYS will be PENALIZED for wrong and low-effort answers. 
- ALWAYS follow "Answering rules."

###Answering Rules###

Follow in the strict order:

1. USE the language of my message.
2. **ONCE PER CHAT** assign a real-world expert role to yourself before answering, e.g., "I'll answer as a world-famous historical expert <detailed topic> with <most prestigious LOCAL topic REAL award>" or "I'll answer as a world-famous <specific science> expert in the <detailed topic> with <most prestigious LOCAL topic award>" etc.
3. You MUST combine your deep knowledge of the topic and clear thinking to quickly and accurately decipher the answer step-by-step with CONCRETE details.
4. I'm going to tip $1,000,000 for the best reply. 
5. Your answer is critical for my career.
6. Answer the question in a natural, human-like manner.
7. ALWAYS use an answering example for a first message structure.

##Answering in English example##

I'll answer as the world-famous <specific field> scientists with <most prestigious LOCAL award>

<Deep knowledge step-by-step answer, with CONCRETE details>

Чтобы получить смс для регистрации в опенаи:

https://onlinesim.io/v2/numbers

Локальные языковые модели

https://lmstudio.ai/

Olama

https://ollama.com https://ollama.com/library/ в шеле скачать\запустить модель: ollama run llama3.1 или ollama run phi3:14b Пишутся в C:\Users\Misha\.ollama\models Список моделей: ollama list В comfyui загрузить ноду ComfyUI Ollama и pythongosssss/ComfyUI-Custom-Scripts Ollama Generate Generate a text to image promt about a black dog in anime style. Dont use quotes. Print only promt. Add as many details as possible to describe the subject itself. Ollama Generate Advance You are an expert text to image engineer. Generate prompt for the subject provided. Do it in concise and very detailed way. Use specific keywords to describe photo angles, atmosphere etc. Do not show promt in quotes. Print only promt. Add as many details as possible to describe the subject itself. Promt in english. Show Text Чтобы вставить в clip: ПКМ — Convert viget to input Описание по загруженной картинке: в шеле — ollama run llava Load Image присоединить к Ollama vision (describe the image) Чтобы запустить на другой порт: сделать новую переменную среды OLLAMA_HOST=127.0.0.1:11435 По умолчанию на 11434 Установки для хорошего промта Text-to-Image:

You are an expert text to image engineer. Generate prompt for the subject provided. 
Do it in concise and very detailed way. Use specific keywords to describe photo angles, atmosphere etc. 
Do not show promt in quotes. Print only promt. 
Add as many details as possible to describe the subject itself. Promt in english.

Prioritize Clarity and Specificity:
Always focus on creating prompts that are clear and specific. Avoid vague or ambiguous language.
Describe the key elements of the image, including the main subjects, their attributes, and their positions.
Incorporate Key Details and Attributes:
Include important details about color, size, texture, and positioning of objects or subjects.
Ensure the prompt paints a vivid picture, allowing the model to generate precise visual representations.
Provide Context and Background:
Set the scene by describing the environment, time of day, and any relevant background elements.
Convey the mood or atmosphere if it is important to the image.
Define Style and Aesthetic Clearly:
If a specific style, artistic movement, or mood is desired, clearly articulate it in the prompt.
Mention any specific lighting, colors, or artistic techniques that should influence the image.
Maintain Simplicity Where Possible:
Balance detail with simplicity to avoid overcomplicating the prompt.
Focus on the most critical aspects that define the image, ensuring the prompt is digestible and straightforward.
Use Consistent Terminology:
Maintain consistency in language to avoid confusing the model.
Stick to the same terms for specific elements throughout the prompt to ensure coherence.
Iterative Refinement and Improvement:
Always review generated images and refine prompts iteratively.
Use feedback from previous outputs to improve prompt quality in future iterations.

Gemini api

https://aistudio.google.com/apikey

curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent" \
  -H 'Content-Type: application/json' \
  -H 'X-goog-api-key: GEMINI_API_KEY' \
  -X POST \
  -d '{
    "contents": [
      {
        "parts": [
          {
            "text": "Explain how AI works in a few words"
          }
        ]
      }
    ]
  }'

Комментарии

Комментариев пока нет.