Si fa un gran parlare (e sparlare…) di ChatGPT e delle potenzialità della sua Intelligenza Artificiale.
Ho visto tanti esempi, buoni e cattivi, allarmati o eccitati, di usare questa potentissima tecnologia. Ma quasi tutti erano solo chiacchierate con ChatGPT, oppure poco più.
Ho voluto provare qualcosa in più: usare le API (Application Programming Interface) di ChatGPT spingendo un po’ più in là il confine dell’esplorazione. Visto che sicuramente la capacità di questo LLM (Large Language Model) è tutta sulla linguistica, mi è parso naturale esplorare la possibilità di fargli scrivere un romanzo in autonomia. E, vista la mia passionaccia per la narrativa, ho scelto di provare a fargli usare come “stile di scrittura” il mio.
Beh, to make a long story short: successo pieno! Se volete vedere il risultato, ecco qui il link al PDF: https://bit.ly/PortaDelTempo
Impressionante no? Vi voglio dettagliare i passaggi.
- Ho creato uno script di una sessantina di linee di codice e gli ho passato in input un unico spunto iniziale: “Il protagonista Jon Doe è un pluriassassino ed è stato condannato ad essere proiettato tre secoli nel futuro. Si risveglia nel futuro ma non ha cognizione del suo stato e dovrà ricostruire la sua identità“.
- Con lo script ho fatto generare una quarantina di passaggi della trama del romanzo con un tecnica di “proponi – riassumi – proponi…” in cui non ho dato nessun contributo umano alla generazione del testo.
- Ho usato l’ultimo riassunto ottenuto per far generare (sempre via API) sia il titolo (“La Porta del Tempo: battaglia contro il Signore dei Sogni“) che l’immagine di copertina (quella che trovate in testa all’articolo) e alcune illustrazioni (qui ho usato la API images/generations cioè quella di DALL-E).
Qui il passaggio più complesso: addestrare un modello al mio stile di scrittura. Ho proceduto così:
- Ho raccolto una buona fetta di mia “produzione letteraria” (circa 150.000 parole, cioè 600.000 caratteri) e ho spezzettato il testo in 300 “chunk” da una pagina circa (by the way: codice Python scritto mediante ChatGPT, tanto per gradire).
- Con un altro script ho dato in pasto i trecento prompt a GPT-3 chiedendo di estrarne una sintesi minimale. Ho impacchettato il tutto usando le sintesi come “prompt” e i testi originali come “completion” e ho addestrato in fine-tuning un nuovo modello di GPT-3 (per i curiosi si chiama “davinci:ft-andrea-bonvicini:stileab-2023-01-15-14-50-14“)
- Ho preso il primo spunto del romanzo suggerito da GPT-3 al passo 2 e gli ho fatto generare la prima pagina del romanzo, intitolata “La stanza era vuota“. Beh, vi posso giurare che lo stile collima con il mio in maniera davvero impressionante…
Al termine dell’elaborazione (nota da ricordare: l’unico input umano sono poche righe di testo per lo spunto iniziale) ho tutto direttamente in un documento Word generato in automatico e quel che mi basta è formattarlo con qualche click, impaginare le immagini… et voilà! (ecco qui di nuovo il link al PDF: https://bit.ly/PortaDelTempo)
A questo punto avrei potuto continuare il loop e fargli generare le altre pagine ma mi è bastato, anche perché usare le API di GPT-3 ha un costo. Già, il costo: meno di 35 dollari… di cui la gran fetta (32-33$ dollari circa) per addestrare il modello linguistico.
In buona sostanza, una volta addestrato il modello con il mio personale stile di scrittura, potrei generare romanzi “a manetta” al costo di un paio di dollari l’uno…
Lesson learned, ora:
- la potenza degli strumenti è davvero impressionante;
- per sfruttarla ChatGPT è una bella interfaccia semplice e intuitiva, ma le API possono dare ottime soddisfazioni in termini di automazione e di settaggio fine del risultato;
- se vuoi ottenere testi consistenti è necessario il fine-tuning di un modello;
- fare il fine-tuning è piuttosto semplice (GPT-3 mette a disposizione una serie di strumenti CLI che velocizzano il tutto e non è male l’idea di coinvolgere sempre GPT-3 nel processo di definizione prompt-completion);
- bastano (e probabilmente avanzano) 300 coppie prompt-completion per addestrare il modello.
Ringraziamenti
Spunti di programmazione li ho trovati in due esperti, uno italiano e uno statunitense:
- Alessio Pomaro: https://www.alessiopomaro.it/ https://www.linkedin.com/in/alessiopomaro/
- Dave Shapiro: https://www.davidkshapiro.com/ https://www.linkedin.com/in/dshap-automator/
A loro i miei più sentiti ringraziamenti!
You cann enjoy an icentical expertise tto that of a human massage.
Many people discover a sensual experience like this helps them
to stimmulate their libido. She was conscious of my wants and made sure I
felt like a princess, pampered annd spoilt, and wanting
nothing but to be buried in a comfortable bathrobe.
Stresds can affect you to really feel like the heaviness of the
world is on your shoulders, and a sensual therapeutic massage
can carry that weight, as well as influence you to feel like you mighbt
be strolling on a cloud. Massage chairs are used to ship full body heat.
These muscles are thought-about the most affected elements of the body
which is stuffed with stress and tension of on a regular
baeis residing. Rest is beneficial after to take pleasure in iits full advantages.
These are really useful for use a few occasions each wee to control
the dandruff. It’s always best to heat up your physique so the muscles
of the agaain are versatile. There are quite a few causes comparable
to injury or strains too the dedcrease back. We seem to eed to work
tougher just to stay where we’re. But how many instances do you must go
for a therapeutic massage to permanently eliminate musce
tension?
Check out my webpage :: carmensinternational.com
Traditional Thai massage, or ‘nuat phaen boran’, is an ancient style of remedy that dates again more than 300 years.
Music, therapeutic massage, therapy, and cozy accommodation set the proper temper to
bee taught and chill out. Liike anyy for of massage, the advantages
enhance with repeated treatments. These therapies alsso are used
to deal with orthopedic accidents, promote hair growth,
and anti-aging therapies similar to pores and skin rejuvenation. A
firm massage caan be achieved on the thighs because off muscle mass and thick skin and that power aids in breaking up onerous
scar tissue. Take only what you’ll be able
to hold comfortably. Men has a tendency to get satisfaction aand to reach the pleasure stage in steps
and for tuat our young ladies wwho look adoring with curvy physic will
definitely take you to thee world of cupid forr complete and glad therapeutic massage.
Take servgice from thhe chief, India’sbest body mmassage spa, we’re professionals, trustable, secure spa in Bangalore.
How Can Justdial Help find the most effective Massage Centres for Women Nearby?
Ayurfveda therapy coaching India gives the most effective
data and covers all of the matters regarding physique sorts and totally different sorts of therapeutic massage.
Have a look at my homepage … sailing-mates.com
دولار مقابل الدينار العراقي في بورصة الكفاح اليوم شكرًا لك..
دولار مقابل الدينار العراقي في بورصة الكفاح اليوم شكرًا لك..
ة العامة لتجارة السيارات والمكائن ومصرف الرافدين بالتقسيط 2015 شكرًا لك..
This iis the reasoln maany people who understand the need for peace of mind and tranquility
are booking extra massage periods today. In addition, giving a extra vigorous therapeutic massage
wll burn extra calories than a slower, floor-level therapeutic massage.
If she is the sentimental kind, this idea will pull on her
coronary heart strings. Pull out some outdated romantic photographs and a
numner of the old flame letters or playing cards
she wrote to you. Find out what hher mmost cherished youngster hood
possession waas and try to trace it down. Perhaps it’s a one off
a sort Barbie doll, or that speciawl teddy she gained at the
Royal Easter Show that stored her firm every evening as
a younger youngster. To keep spirit up throughout a
tough time, suppose about finding this type of facility on your or
your loved one. When you (or somebody you know) have ann interest
in finding acu-therapy programs, let skilled coaching inside fast-rising industries like massage
therapy, cosmetology, acupuncture, oriental medication, Reiki, and others get
you began! However, you do noot requore a lot tike when utilizing knowledgeable percyssion massager.
Progressive Resistance: Using more resistance with every set youu carry out.
Also visit my blog post: https://yourkinkinpink.com
أكبر شركة لانتاج أنابيب البولي ايثيلين و يو بي سي ومستلزماتها للمنتجات الصناعية في عيراق