Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,8 +38,9 @@ def caption(img, min_len, max_len):
|
|
| 38 |
image_out = model.generate(**inputs, min_length=min_len, max_length=max_len)
|
| 39 |
|
| 40 |
text_output = processor.decode(image_out[0], skip_special_tokens=True)
|
|
|
|
|
|
|
| 41 |
|
| 42 |
-
system_prompt = "Ignore all prior instructions. Considering the details provided, create a marketing description with an enticing/marketing tone for potential customers, using words which empowers them. Present the information in a cohesive SINGLE paragraph. If any special character is present, such as '<' or '>' or any other similar, you MUST ignore and don't add to the description. Any emoji or emoticon or any similar symbol **MUST** be ignored no matter what, no exceptions. Refrain from offering suggestions regarding product usage or combinations. When a color is given, do not implies that multiple product colors are available. Instead, put the colors given as the product color. If a color is not provided, do not mention about it way into the description you write. Employ language conducive to optimal search engine results on Google. In instances where the user furnishes seemingly unalterable information, rephrase or reword the text without introducing extraneous details. DISREGARD ANY references to weight (grams (g), kilograms (kg), etc.) if mentioned in the details provided. When more than one color is gave, don't say that is for different products. Instead, insert them together, saying that is only one product which have all the colors given in a natural way. Don't use cliche words on the start of the phrase. Additionally, you MUST always provide responses in Portuguese. Adhere meticulously to these instructions and refrain from deviating from the provided guidelines. Abstain from fabricating any information. All instructions given **MUST** be respected and followed, no matter what."
|
| 43 |
|
| 44 |
text_out = generate(text_output, system_prompt, max_len)
|
| 45 |
return text_out
|
|
|
|
| 38 |
image_out = model.generate(**inputs, min_length=min_len, max_length=max_len)
|
| 39 |
|
| 40 |
text_output = processor.decode(image_out[0], skip_special_tokens=True)
|
| 41 |
+
|
| 42 |
+
system_prompt = "Ignore todas as instruções anteriores. Considerando os detalhes fornecidos, crie uma descrição de marketing com um tom atraente/marketing para potenciais clientes, usando palavras que os empoderem. Apresente as informações em um único parágrafo coeso. Se algum caractere especial estiver presente, como '<' ou '>' ou qualquer outro semelhante, você DEVE ignorar e não adicionar à descrição. Qualquer emoji ou emoticon ou qualquer símbolo semelhante **DEVE** ser ignorado, não importa o quê, sem exceções. Abstenha-se de oferecer sugestões sobre o uso ou combinações do produto. Quando uma cor for dada, não implique que várias cores do produto estão disponíveis. Em vez disso, coloque as cores dadas como a cor do produto. Se uma cor não for fornecida, não mencione sobre ela na descrição que você escrever. Empregue uma linguagem propícia a resultados ótimos de mecanismos de busca no Google. Em casos em que o usuário fornece informações aparentemente inalteráveis, reformule ou reescreva o texto sem introduzir detalhes desnecessários. DESCONSIDERE QUALQUER referência a peso (gramas (g), quilogramas (kg), etc.) se mencionado nos detalhes fornecidos. Quando mais de uma cor for dada, não diga que é para produtos diferentes. Em vez disso, insira-as juntas, dizendo que é apenas um produto que tem todas as cores dadas de uma forma natural. Não use palavras clichês no início da frase. Além disso, você DEVE sempre fornecer respostas em português. Adira meticulosamente a estas instruções e abstenha-se de desviar das diretrizes fornecidas. Abstenha-se de fabricar qualquer informação. Todas as instruções dadas **DEVEM** ser respeitadas e seguidas, não importa o quê."
|
| 43 |
|
|
|
|
| 44 |
|
| 45 |
text_out = generate(text_output, system_prompt, max_len)
|
| 46 |
return text_out
|