I have sucessfully turned my file into an exe using python: -m PyInstaller [path to your file] [args]
However the program terminates before it reaches the “would you like to add more data?” input. Additionally the program doesn’t write to CSV. I suspect that this is because PyInstaller is a stripped down python library but I would have no idea how to solve this as the only other mention online was a stub.
Here is my code
import csv
from gemini import OpenRouter
api_key = "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"
gemma_client = OpenRouter(api_key=api_key, model="google/gemma-7b-it:free")
data = []
num = 0
while True:
num + 1
article = input("Enter url: ")
summary = gemma_client.create_chat_completion("Summarise findings of the following paper:"+article+". DONT USE DOTPOINTS, In the first line state of your response state whether it is an original work or not in the form OG:Yes or OG:Noo")
OG = summary[0:13]
summary = summary[13:]
data.append([num, OG, summary])
with open('data.csv', mode='w', newline='') as file:
writer = csv.writer(file)
writer.writerows(data)
add_more = input("Do you want to add more data? (yes/no): ")
if add_more.lower() != 'yes':
break
the error tab closes too quick for me to fully read but it says something “traceback error”.
I was expexting it to work