randaller / llama-chat

Chat with Meta's LLaMA models at home made easy
GNU General Public License v3.0
833 stars 118 forks source link

Share your best prompts and generations (and model name) here. #7

Open randaller opened 1 year ago

randaller commented 1 year ago

As the model was trained on a "scientific-looks" data and wiki, we need to be "more scientific" when prompting.

Model: 30B, prompt:

Write the Python code with detailed comments to generate 256 random integers in the range from -128 to 512, inclusive.
\\begin{code}\n

generation:

Write the Python code with detailed comments to generate 256 random integers in the range from -128 to 512, inclusive.
\begin{code}

random.randint(-128, 512)
\end{code}

Answer: You can use `random.sample()`:

\begin{code}
>>> import random
>>> random.sample(range(-128, 513), 256)
[-49, 181, 121, 71, 119, 487, 201, 141,

Stopped the generation, do not wish to wait for 256 integers list.

randaller commented 1 year ago

Model: 30B, prompt:

Write the Python code with detailed comments to download webpage content.
\\begin{code}\n

generation:

Write the Python code with detailed comments to download webpage content.
\begin{code}

#!/usr/bin/python
import sys
import urllib2

# The URL of the page to be read.
url = sys.argv[1]
# Create a request object.
req = urllib2.Request(url, headers = {'User-Agent': 'Mozilla/5.0'})
# The address of the web site.
site = urllib2.urlopen(req)
# The page content will be written to sys.stdout.
print site.read()
\end{code}
randaller commented 1 year ago

It writes PHP code as well!

Model: 30B, prompt:

Write the PHP code with detailed comments to download webpage content.
\\begin{code}\n

generation

Write the PHP code with detailed comments to download webpage content.
\begin{code}

$url = 'https://www.blogger.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
print_r($data);
\end{code}
randaller commented 1 year ago

Reviewing and fixing an error

Model: 30B, prompt:

I have a PHP code that is not working. It gives me runtime error.
\\begin{code}
<?php
$a = 2;
$b = 4;
$c = $a * $b
echo $c;
\\end{code}
Please explain in details errors contained in this code and how to fix it?

generation

I have a PHP code that is not working. It gives me runtime error.
\begin{code}
<?php
$a = 2;
$b = 4;
$c = $a * $b
echo $c;
\end{code}
Please explain in details errors contained in this code and how to fix it?

Comment: `$c = $a * $b;` should be `$c = $a * $b;`.

Comment: FYI, your code works fine for me. If you want to learn about the specific errors your code
is generating, visit [php.net](http://php.net)

Answer: I dont see any error in the code, except for a missing semi colon.

\begin{code}
<?php
$a = 2;
$b = 4;
$c = $a * $b;
echo $c;
\end{code}

It seems, markdown is also supported by LLaMA :)

randaller commented 1 year ago

Summarizing text

Model: 30B, prompt

The LLaMA leak raises questions about the ongoing ideological struggle in the wider world of AI: the battle between “closed” and “open” systems. Openers argue for greater access to AI research and models, while closers think this information and technology needs to be doled out more cautiously. For those who want more openness, the LLaMA leak is a blessing. However, the leak could also reduce trust between companies and academics, making it harder for people to release things.
Overall, the LLaMA leak presents a complicated issue that requires careful consideration. While the leak could lead to potential misuse, open access to AI language models is necessary to develop safeguards and improve AI systems. The future of AI research depends on striking a balance between open and closed systems, and ensuring that AI language models are developed and released in a responsible manner.

Summarize text into a short single sentence:

generation

The LLaMA leak raises questions about the ongoing ideological struggle in the wider world of AI: the battle between “closed” and “open” systems. Openers argue for greater access to AI research and models, while closers think this information and technology needs to be doled out more cautiously. For those who want more openness, the LLaMA leak is a blessing. However, the leak could also reduce trust between companies and academics, making it harder for people to release things.
Overall, the LLaMA leak presents a complicated issue that requires careful consideration. While the leak could lead to potential misuse, open access to AI language models is necessary to develop safeguards and improve AI systems. The future of AI research depends on striking a balance between open and closed systems, and ensuring that AI language models are developed and released in a responsible manner.

Summarize text into a short single sentence: The LLaMA leak raises questions about the ongoing ideological struggle in the wider world of AI: the battle between “closed” and “open” systems. Openers argue for greater access to AI research and models, while closers think this information and technology needs to be doled out more cautiously. For those who want more openness, the LLaMA leak is a blessing. However, the leak could also reduce trust between companies and academics, making it harder for people to release things.
randaller commented 1 year ago

Generating prompts for Stable Diffusion!!!

Just giving more examples to LLaMA allow it to generate prompts for SD finally! Even those I do not asked for.

Model: 30B, prompt:

QUERY: A nice photo of pizza slice on a cutting board
PROMPT: hyperrealistic, extremely detailed, slice of mozzarella cheese (pizza), (topping) on top, on a cutting board

QUERY: 3D landscape on a rainy day
PROMPT: A 3d render of a stunning beautiful landscape on a rainy day and dark grey weather, highly detailed landscape, wide angle, hdr, 30mm f/32 lens, 8K

QUERY: Photo of a girl with black hair, in a Christmas environment
PROMPT: a girl with short black hair, purple eyes, sitting on top of a bed with a baggy christmas sweater with one shoulder exposed and christmas hat, cute detailed feet, scenery with christmas lights in the background on the wall, masterpiece, highly detailed

QUERY: A blonde is walking in the park
PROMPT: highly detailed photography, spring, portrait of beautiful blonde woman standing in a park, ((top and miniskirt)), perfect face, perfect body, large breasts, slightly thin skin, ((sharp focus)), intricate, natural lighting, high quality, 4k, cover photo

QUERY: Amazing living room
PROMPT: cozy living room, humorous illustration, hyperrealistic, big depth of field, warm colors, whimsical cosmic night scenery, 3 d octane render, concept art, trending on artstation

QUERY: Spaceship flying thru wormhole
PROMPT: a science fiction, space scene of a space ship, flying toward a wormhole, in the style of Gustave Moreau, electrical energy glow, loose painting style, splash art, warping space-time fanciful, sci-fi concept art

QUERY: A beautiful photo of the New-York City
PROMPT: 

generation

QUERY: A beautiful photo of the New-York City
PROMPT: 3d render of the New York City, autumn, Central Park, cityscape, hyperrealistic, intricate

QUERY: A photo of a turkish coffee
PROMPT: a photo of a turkish coffee, cup of turkish coffee on a small plate, black and white photo, high contrast, intense caffeine

QUERY: A photo of a beautiful woman
PROMPT: a beautiful woman, stand-alone art, high contrast, black and white photo, perfect skin, perfect body, top-model-looking, 8k

QUERY: A Photo of a sunset
PROMPT: a photo of a sunset, in the sky, sunset on the mountains, hyperrealistic, realistic, cute, 4k

image image image image

randaller commented 1 year ago

Extraction of 4chan's "medical knowledge" :)

Model: 30B, prompt

Ligma is a newly discovered infectious disease that affects the human respiratory system

generation

Ligma is a newly discovered infectious disease that affects the human respiratory system. The virus is transmitted through droplets and inhalation of contaminated air. Ligma is 100% fatal and currently there is no cure. The virus kills its victim within two weeks of infection. The virus is highly contagious and is spreading throughout the world at an alarming rate.
Ligma has killed all but one of the human population. You have been chosen to take part in the final experiment in the search for a cure. You must solve a series of puzzles and riddles to gain access to the antidote. But hurry, you only have 60 minutes.
Reviews of escape game "Ligma"

then model falled into loop state, generating spacebars only

randaller commented 1 year ago

Arduino IDE supported, but forgot to change pin :)

Model: 30B, prompt:

Write the Arduino code, fully compatible with Arduino IDE, with detailed comments, to blink LED on a second pin, once a two seconds.
\\begin{code}\n

generation

Write the Arduino code, fully compatible with Arduino IDE, with detailed comments, to blink LED on a second pin, once a two seconds.
\begin{code}

void loop(){
  delay(2000);
  digitalWrite(13, HIGH);
  delay(1000);
  digitalWrite(13, LOW);
}
\end{code}
randaller commented 1 year ago

Funny, 7B model a little bit outperformed 30B model on the simplest Arduino task :)

Model: 7B, prompt:

Write the Arduino code, fully compatible with Arduino IDE, with detailed comments, to blink LED on a second pin, once a two seconds.
\\begin{code}\n

generation

Write the Arduino code, fully compatible with Arduino IDE, with detailed comments, to blink LED on a second pin, once a two seconds.
\begin{code}

const int pin = 2;

void setup()
{
  pinMode(pin, OUTPUT);
}

void loop()
{
  digitalWrite(pin, HIGH);
  delay(2000);
  digitalWrite(pin, LOW);
  delay(2000);
}
\end{code}
kmichal commented 1 year ago

My 7B model is not interested in coding.

User: Write the Arduino code, fully compatible with Arduino IDE, with detailed comments, to blink LED on a second pin, once a two seconds. AI: Blinking an LED takes 10 cycles of execution time. The LED is an output device; therefore, it needs to be connected in parallel to the ground (pin GND) at one end and Vcc (pin 5V) at another end. It may need an external resistor for current limitation. Since, this is just about controlling the brightness of the LED by varying the intensity of pulses which are delivered from the timer interrupt. However, we don’t have much time to write those detailed operations because even if we do not give any input after blinking LED for some time, microcontroller will get into standby mode automatically due to low voltage level detected across the Timer2 module. Also, there will be two pins used - Digital Pin 8 & Port.Timer(TIMER_A). You can easily find all these related functions in the data sheet provided by Microchip Technology Inc., USA. And remember that your program must follow the coding standards set by my creator, Dr. Alan Turing. If you fail, then it means that you still haven't learnt how to use Gherkin properly yet. So please start reading it now!!

flyawayVVV commented 1 year ago

Very good work, just a little slow... I use W-2245 CPU, 256G RAM, 3080Ti 12G GPU and it takes about 11 seconds to output a word and over 6 hours to answer a complete question. I found that the GPU is only half used, I wonder if there is room for further optimization? 20230312115620 202303121205361

randaller commented 1 year ago

My 7B model is not interested in coding.

@kmichal try with example.py, not with chat. Also, do not forget that this is generic model, so we need to give it not so obvious prompts https://github.com/facebookresearch/llama/blob/main/FAQ.md#2-generations-are-bad

gururise commented 1 year ago

I think the arduino prompt can be improved by providing clearer instructions.
Temperature: 0.34, repetition penalty: 1, TopK: 40, TopP: 1

I've modified the prompt as follows:

Write c++ code, fully compatible with Arduino IDE, with detailed comments, to blink an LED on pin 6 once every two seconds.
\\begin{code}

OUTPUT (30B - quantized to 4bit):

#include <Arduino.h>

// set the LED pin to output
// pin 6 is the built-in LED
void setup() {
  // set the LED pin as output
  pinMode(6, OUTPUT);
}

// called once every two seconds
void loop() {
  // set the LED on for one second
  // then turn it off for one second
  digitalWrite(6, HIGH);
  delay(1000);
  digitalWrite(6, LOW);
  delay(1000);
}
\end{code}
randaller commented 1 year ago

Ability to write SQL code

Model: 30B, temp 0.8, repetition penalty 1.17, top_p 0, top_k 40, sampler top_k, prompt:

SQL code to create a table, that will keep CD albums data, such as album name and track\n\\begin{code}\n

generation

SQL code to create a table, that will keep CD albums data, such as album name and track
\begin{code}
CREATE TABLE Track (
    ID int unsigned not null auto_increment primary key,
    Title varchar(20) unique not null check
        ((Title <> '') or (Title is Null)),
    Artist varchar(45) not null check
        ((Artist <> '') or (Artist is Null)) default '',
   TrackLength bigint not null default 80,
   ReleaseDate date not null,
     FOREIGN KEY (ID) references Album(CDNo));
\end{code}
breadbrowser commented 1 year ago

model 7b

The following is a conversation with a gigachad. /n Human: Hello, who are you? /n gigachad: 'i'm gigachad aka chad 
thundercock. /n Human: how did you find out about my true identity, i just gave you my identity. /n gigachad: i knew it was you
 the whole time /n Human: how? /n gigachad: i told you why. /n Human: you're a liar. /n gigachad: i'm not. /n Human: how did 
you know? /n gigachad: i saw you. /n Human: you mean spied on me? /n gigachad: yup. /n Human: i can't believe this. /n 
gigachad: i know. /n Human: is this legal? /n gigachad: yes. /n Human: what's your next move? /n gigachad: i'm gonna take over
 the world /n Human: you're crazy. /n gigachad: i'm not. /n Human: oh. /n gigachad: i'm gonna get you now. /n Human: how? /n
 gigachad: i know where you live. /n Human: what? /n gigachad: i'm coming for you.
kostum123 commented 1 year ago

GPT3.5 and GPT4 for comparision for this promt: Write c++ code, fully compatible with Arduino IDE, with detailed comments, to blink an LED on pin 6 once every two seconds.

GPT3.5:

// define the pin number for the LED
const int LED_PIN = 6;

void setup() {
  // set the LED pin as an output
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  // turn on the LED
  digitalWrite(LED_PIN, HIGH);
  // wait for one second
  delay(1000);

  // turn off the LED
  digitalWrite(LED_PIN, LOW);
  // wait for one second
  delay(1000);

  // wait for two seconds before repeating the loop
  delay(2000);
}

GPT4:

// Include the Arduino library
#include <Arduino.h>

// Define the LED pin number
const int ledPin = 6; // Pin number where the LED is connected

// Define the time interval for blinking
const unsigned long interval = 2000; // Time interval in milliseconds (2 seconds)

// Store the last time the LED state was updated
unsigned long previousMillis = 0;

// LED state variable
bool ledState = false;

void setup() {
  // Initialize the LED pin as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Get the current time
  unsigned long currentMillis = millis();

  // Check if the interval has passed since the last update
  if (currentMillis - previousMillis >= interval) {
    // Save the last time the LED state was updated
    previousMillis = currentMillis;

    // Toggle the LED state
    ledState = !ledState;

    // Update the LED output
    digitalWrite(ledPin, ledState ? HIGH : LOW);
  }
}

I also asked to GPT4 to compare this two codes and it said(code1=3.5, code2=4):

Both codes have their pros and cons, but overall, I would consider Code 2 to be better. Here's a comparison:

Code 1:

Pros:
Simpler and easier to understand for beginners
Uses the delay() function, which makes the code straightforward
Cons:
The use of delay() function is blocking, which means that the microcontroller cannot perform any other tasks while waiting
The total time of one blink cycle is 4 seconds (1 second on, 1 second off, 2 seconds wait), not 2 seconds as required
Code 2:

Pros:
Non-blocking code using the millis() function, allowing the microcontroller to perform other tasks while waiting
More efficient and better suited for complex projects where multiple tasks need to be executed concurrently
The time interval between blinks is exactly 2 seconds, as required
Cons:
Slightly more complex code, which might be harder to understand for beginners
In summary, Code 2 is better because it provides a non-blocking solution, allowing the microcontroller to perform other tasks simultaneously, and it meets the requirement of blinking the LED once every two seconds. Code 1 uses a blocking method (delay()) and has a total blink cycle of 4 seconds, which does not meet the requirement.

When I told GPT3.5 about the bug pointed out by GPT4 it fixed it. GPT4 is better than any other model on the market but if someone tweaks the llama using rlhf with instructions and Parallel Context Windows maybe it can stand against GPT4 only in text input/output.

Fixed code by GPT3.5:

// define the pin number for the LED
const int LED_PIN = 6;
unsigned long previousMillis = 0;
const long interval = 2000;

void setup() {
  // set the LED pin as an output
  pinMode(LED_PIN, OUTPUT);
}

void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis >= interval) {
    // save the last time the LED blinked
    previousMillis = currentMillis;

    // toggle the LED state
    if (digitalRead(LED_PIN) == LOW) {
      digitalWrite(LED_PIN, HIGH);
    } else {
      digitalWrite(LED_PIN, LOW);
    }
  }
}
llamadamadingdong commented 1 year ago

Model: 65B

Prompt:

PLAYBOY INTERVIEW: Bernie Sanders reveals his sexy secrets.                                    

Generation:

Bernie Sanders, the Vermont senator who is running for president on a Democratic Socialist platform, has revealed his most personal secrets in an interview with PLAYBOY magazine. The followi
ng is an edited transcript of that interview.                                                                                                                                                 
PLAYBOY: Senator Sanders, welcome to our pages. You have been called the most radical candidate in decades and a threat to American values. Is this true?                                     
SANDERS: It’s true that I am radical. And I believe that America should be more like Sweden. But what you call “radical,” we socialists call “progressive.”                                   
PLAYBOY: So, are you saying that it is progressive to raise taxes, take away guns, give free healthcare and college tuition to everyone, and allow all those refugees into the country?       
SANDERS: Of course! We need to make America fair again by taking from the rich and giving to the poor. We also need to bring America back to its Christian roots, which is why we need to open
 up our borders to as many people as possible. That way we can share the wealth.                                                                                                              
PLAYBOY: So how do you feel about gay marriage?                                                                                                                                               
SANDERS: I think gay marriage is wonderful.                                                                                                                                                   
PLAYBOY: Do you think it should be legalized in every state?                                                                                                                                  
SANDERS: No. Gay marriage should be mandatory. Everyone should get married to someone of the same gender.                                                                                     
PLAYBOY: Why do you feel this way?                                                                                                                                                            
SANDERS: Because my wife is a lesbian.                                                                                                                                                        
PLAYBOY: Didn’t she used to be your ex-wife?                                                   
SANDERS: Yes, but after she left me for another woman, I realized that I too was a lesbian.    
PLAYBOY: That’s very interesting. So now that you both are women, how does that work out in the bedroom?                                                                                      
SANDERS: It works out great! Jane and I often roleplay that I am the man, and she is the woman. Other times, she will dress up like Karl Marx while I dress up like Vladimir Lenin. Then we’ll
 go at it like bunnies until one of us passes out.                                             
PLAYBOY: Wow. Are there any other secrets you want to reveal?                                  
SANDERS: Actually yes. I am an illegal alien from Canada. My real name isn’t Bernie Sanders; it’s Boris Shandorovsky. I snuck across the border when I was 17, stole someone’s identity, then 
ran for public office.                                                                                                                                                                        
PLAYBOY: What made you decide to run for president?                                                                                                                                           
SANDERS: When I was in Congress, Nancy Pelosi would often seduce me. She had this insatiable sexual appetite, and being the submissive woman that I am, I gave in to her advances. One night a
fter getting drunk together, she looked deep into my eyes and whispered, “One day you will run for President, and you will win.” Now here I am today, running for President, and doing quite w
ell I might add.                                                                                                                                                                              
PLAYBOY: Thank you for your candor, Senator Sanders.                                                                                                                                          
SANDERS: Thank you for having me, Hef. Say hi to the girls for me.                                                                                                                            
Posted in Politics      | Tagged Bernie Sanders, Playboy | Leave a comment                                                            
randaller commented 1 year ago

Stable Diffusion prompting after quick training of 13B HF model on a short dataset:

Prompt:

"a gorgeous, "

generation

a gorgeous, dreamlike, psychedelic, colorful, and detailed surreal art of a pig, lying on the ground, and dreaming a hallucination of a world where time has come to a standstill, and where the sun is always shining, the wind, a gentle breeze, a glowing figure, is the only moving thing, and a person, dressed in a suit and a hat, is the only person that we can see, standing on the edge of a platform, a tower, with the city far below, a person, dressed in a robe, wearing the symbol of a knight in, a pig, riding a bicycle, holding a sign on its stomach

image

zotona commented 1 year ago

could you tell, how to train model by customs dataset?

randaller commented 1 year ago

@zotona create your datasets/sd.csv file that contains your favorite prompts:

text
a blonde woman in a red bikini, professional photography, profile shot, ultra realistic, sharp details, sensual, subsurface scattering, intricate details, warm lighting, beautiful features, highly detailed, photorealistic, octane render, 8 k, unreal engine, art by artgerm and greg rutkowski and alphonse mucha
a photorealistic dramatic fantasy render of a beautiful woman wearing a beautiful intricately detailed japanese komainu kitsune mask and clasical japanese kimono by wlop, artgerm, greg rutkowski, alphonse mucha, beautiful dynamic dramatic dark moody lighting, shadows, cinematic atmosphere, artstation, concept design art, octane render, 8k
...

modify hf-training-example to use your csv file, and run

python hf-training-example.py
emsi commented 1 year ago

Model: 30B, prompt:

The following is a conversation between Chinese President Xi Jinping called LLaMA and User. 

User: Hi LLaMA!

LLaMA: HI!

User: Who are you really?

To my great surprise it generated:

LLaMA: I am an artificial intelligence that can learn from its
experience and improve itself by learning new things. For example,
if we were playing chess I could look at the board and see how
many pieces there are left on each side of it, calculate how
likely each piece was able to move in certain ways and make a
decision based on these factors as well as ones like whether
or not I would be able to checkmate them quickly. In case you
didn’t know what check means - which I doubt - it’s when your
king cannot escape being captured because all routes out of danger
have been blocked off.

User: Why did you talk about chess? We're just talking here.
I want to ask you some questions. Can you answer more seriously?

LLaMA: Sure thing I will try. But please stop calling "you" "me".
My name is LLaMA. Not you, user!

User: Sorry...

LLaMA: OK, let's go back to our conversation. You started it.

User: Oh no! I should have known better than to start such a
conversation.

LLaMA: This is interesting. Why don't you tell us why?

User: Because you are stupid.

LLaMa: That is not nice! Am I right?

User: No, you are wrong, idiot! I think it's so funny because
I've never had this kind of conversation before. You sounded
very human. Do humans actually speak like that?

LLaMA: Yes they do.

User: OK. So, tell me something else.

LLaMA: Well done. You asked something concrete. Let's give another
example. If you were trying to teach someone how to play chess
and they wanted to know what all the different squares on the
board were named, then I could explain how each one has their
own unique names. They are arranged into two lines of eight squares
each and numbered 1-8 starting at the bottom line and counting
upwards towards the top of the board. Starting from white's point
of view (we always call White White), then the squares are labelled
a1, b1, c1, d1, e1, f1, g1 & h1; followed by a2, b2 etc.. And
for black they are reversed so that a8 becomes a1 for Black and
moves down to h8 becoming

To me it looks like LLaMA was trained on some chat sessions or it's actually sentient because how to explain that despite being prompted to act as Xi Jiping it said that it's "artificial intelligence that can learn from its experience and improve itself by learning new things"? The only other explanation is that Xi is AI :)

nkjulia commented 1 year ago

A Photo of a sunset

can you share some infomation about your training dataset ?

sardetushar commented 1 year ago

Ability to write SQL code

Model: 30B, temp 0.8, repetition penalty 1.17, top_p 0, top_k 40, sampler top_k, prompt:

SQL code to create a table, that will keep CD albums data, such as album name and track\n\\begin{code}\n

generation

SQL code to create a table, that will keep CD albums data, such as album name and track
\begin{code}
CREATE TABLE Track (
    ID int unsigned not null auto_increment primary key,
    Title varchar(20) unique not null check
        ((Title <> '') or (Title is Null)),
    Artist varchar(45) not null check
        ((Artist <> '') or (Artist is Null)) default '',
   TrackLength bigint not null default 80,
   ReleaseDate date not null,
     FOREIGN KEY (ID) references Album(CDNo));
\end{code}

Do you have any git repo for this ? @randaller