It was both, Hunter wrote the song before the fan.
I don't remember the exact year but mid '70s they were recording at the pad Jerry had and the main room didn't have air conditioning so they had a huge industrial fan to keep the room cool.
The fan was so powerful that it would slowly move itself from one corner of the room to the other. So every half hour someone would have to get up and put Bertha back in the corner. "Bertha don't you come around here anymore" was how the fan got the name
This comes from the book "Garia - An American Life" by Blair Johnson. It's a really really really good book following Jerry's life from losing his middle finger chopping firewood to almost losing his life in a car accident and then a good ~300 pages following his life in the band and all of the characters he hung around or worked with.
https://www.amazon.com/Garcia-American-Life-Blair-Jackson/dp/0140291997/
This is one of the best I've read. He wasn't a perfect person, hardly, he was kind of a crappy Dad and husband, but he was a complicated and intelligent person who found himself at the crossroads of American history and was a good friend to his friends, and an amazing musician.
One thing I did not like about this book was the author periodically going off on lyrics and songs trying to impose his, "interpretations". Fortunately, I was able to breeze past those and enjoy the rest of the book.