Gigishot commited on
Commit
d3c4072
·
verified ·
1 Parent(s): 6971d27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -8
app.py CHANGED
@@ -22,16 +22,21 @@ MODELS = [
22
  def generate_blog(topic):
23
 
24
  prompt = f"""
25
- Write a detailed and engaging blog article on the topic: "{topic}"
 
26
 
27
- The blog should include:
28
- - A catchy title
29
- - Introduction
30
- - Main content
31
- - Conclusion
 
 
32
 
33
- Blog:
34
- """
 
 
35
 
36
  for model in MODELS:
37
  try:
 
22
  def generate_blog(topic):
23
 
24
  prompt = f"""
25
+ Write a short engaging blog about: {topic}
26
+ """
27
 
28
+ try:
29
+ response = client.text_generation(
30
+ model="google/gemma-2b-it",
31
+ prompt=prompt,
32
+ max_new_tokens=300,
33
+ temperature=0.7,
34
+ )
35
 
36
+ return str(response)
37
+
38
+ except Exception as e:
39
+ return f"Error: {e}"
40
 
41
  for model in MODELS:
42
  try: